|
Dynamic HTML (DHTML)
is an enhancement to HTML version 4.0, and can be used to
create enhanced visual effects on a WWW page. It works with
Microsoft Internet Explorer 4.0 and Netscape Navigator 4.0,
and later. The simplest way to reference an element in
DHTML is to use the elements id tag. For
example:
DHTML example
|
|
<html><head><title>ID referencing</title></head>
<script type = "text/javascript">
function go()
{
alert(mytext.innerText);
mytext.innerText = "Goodbye";
}
</script>
<body onload="go()">
<p id="mytext">Hello, how are you?</p>
</body>
</html>
|
Executed code
|
|
Hello, how are you?
|
|