Saturday, February 20, 2010

How to dynamically change the content of your HTML using Javascript?

<span id="myHTML"></span>

document.getElementById('myHTML').innerHTML = htm;   // where 'htm' is a variable to hold the HTML codes you want to display in the <span> portion.

You can set up a Javascript function to handle this dynamic capability and receive event calls from omouseover, onload, ... HTML event as a trigger to the change of content. You can also set up a timer to change the content periodically.

No comments:

Post a Comment