javascript - Double quote makes JS program works incorrectly -
for following code, hope print
span1: span:"dd"
where type in dd in textbox, in end, appears
span1: span:"dd
every thing after dd
disappeared!
<html> <head> <script> function check(){ var txt=document.getelementbyid("hello").value; document.getelementbyid("sp").innerhtml=txt; } </script> </head> <body> <input type="text" id="hello"/><br/> span1:<span id="sp1"/><br/> span:"<span id="sp"/>" <br/> <input type="submit" onclick="check()"/><br/> </body> </html>
Comments
Post a Comment