标签:style blog class code java c
问题1:
<html> <head> <script type="text/javascript"> function pass() { var str1 = document.getElementById("1").value; var str2 = document.getElementById("2").value; str2 = str1; } </script> </head> <body> <label for="1">1:</label><input type="text" id="1" onblur="pass();"><br /> <label for="2">2:</label><input type="text" id="2"> </body> </html>
不知道这段代码出问题的根源是什么位置。下面的写法就能正常工作了。
<html> <head> <script type="text/javascript"> function transfer() { var str1 = document.getElementById("1").value; document.getElementById("2").value = str1; } </script> </head> <body> <label for="1">1:</label><input type="text" id="1" onblur="transfer()"><br />
<label for="2">2:</label><input type="text" id="2">
</body>
</html>
标签:style blog class code java c
原文地址:http://www.cnblogs.com/zgyskc/p/3720398.html