I'm a noob at javascript and I'm trying to get the text "Hi" to appear when I click the link, but its not working. Does anyone know why?
HTML Code:<a href="javascript: document.getElementById(text).innerHMTL = 'Hi';">View</a> <div id="text"></div>
I'm a noob at javascript and I'm trying to get the text "Hi" to appear when I click the link, but its not working. Does anyone know why?
HTML Code:<a href="javascript: document.getElementById(text).innerHMTL = 'Hi';">View</a> <div id="text"></div>
try putting quotes on document.getElementById("text").innerHTML
That should make it work.
just change the order and try like this
<div id="text"></div>
<a href="javascript: document.getElementById("text").innerHMTL = 'Hi';">View</a>
[LEFT][B]Sunil Sankar
-------------------------------------------------------------------------