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:&quot;<span  id="sp"/>&quot; <br/>                  <input type="submit" onclick="check()"/><br/>   </body>  </html> 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -