javascript实现点我加一

xiaoxiao2021-02-28  94

javascript实现点我加一

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>点我加一</title> <script type="text/javascript"> function add(){ var num=document.getElementById("num"); num.value=parseInt(num.value)+1; } </script> </head> <body> <input type="text" id="num" value="0"/> <input type="button" value="点我加一" onclick="add()"/> </body> </html>
转载请注明原文地址: https://www.6miu.com/read-48414.html

最新回复(0)