DHTML Tutorials

DHTML in IE4
Previous Home Next

DHTML in IE does not rely on any one tag, but rather, new objects and properties that stem out of the usual HTML tags you're used to working with, such as <div> and <table>. It's a lot more powerful, but at the same time, and lot more complicated to grasp.

Dynamic content properties in IE are:

  • nnerText The complete textual content of an element.
  • outerText Identical to the above, except when assigning a new value to it, this value replaces the element itself as well.
  • innerHTML The complete content (including HTML tags, if any) of an element.
  • outerHTML The complete content of an element, including the element itself.

Syntax of simple IE in dhtml

<div id="dcontent" style="width:100%; background-color:
#E2E2FC; padding-left: 5px"></div>
<script type="text/javascript">
var mycontent=new Array()
mycontent[0]=' <img src="http://r4r.co.in.com>
Learn about JavaScript and get free scripts at 
<a href="http://r4r.co.in.com">JavaScript Kit!</a>'
var i=0
function altercontent(){
if (document.all)
dcontent.innerHTML=mycontent[i];
i=(i==mycontent.length-1)? 0 : i+1
setTimeout("altercontent()", 3000)
}
window.onload=altercontent
</script>
Previous Home Next