Jump to content

InnerHTML


Viper5646

Recommended Posts

Hi allI am currently learning HTML DOM in W3 Schools.I came across InnerHTML and decided to create a little code using innerHtml, But it doesn't seam to work.When I click the button nothing happens.Can someone give me some info where I went wrong.Thanks.
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>	<title>Title</title></head><body><script type="text/javascript">function newtext(){	var userinput = document.getElementById('userInput').value;	document.getElementById('bolder').innerhtml = userInput;}</script><p>Welcome To The MY Site <b id='bolder'>DUDE</b></p><input type='text' id='userInput' value='type text here' /><input type='button' onclick='newtext()' value='change text' /></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...