Information Technology @ PaynesNotebook.net




DHTML

External Links:

Introduction:

Examples:

Code / Example Result
<script type="text/javascript">
document.write(Date());
</script>
document.getElementById("Id").innerHTML="Text";  
document.getElementById("Id").attribute="Value";  
document.getElementById("Id").style.property="Style";  
<div onclick="this.innerHTML='Event triggered!'">Click me!</div>
Click me!
<script type="text/javascript">

function changeText(id)
{
  id.innerHTML="function changeText(id) invoked.";
  id.style.color="red";
}

</script>

<div onclick="changeText(this);">Click me!</div>
Click me!
<script type="text/javascript">

function mouseUp(id)
{
  id.innerHTML="Mouse UP!";
  id.style.color = "blue";
  id.style.fontWeight = "100";
  id.style.backgroundColor = "yellow";
}

function mouseDown(id)
{
  id.innerHTML="Mouse Down!";
  id.style.color = "red";
  id.style.fontWeight = "900";
  id.style.backgroundColor = "black";
}

</script>

<div onmouseup="mouseUp(this)" onmousedown="mouseDown(this)">Click me!</div>
Click me!