JavaScript in the Browser

Setting Events in DOM Level 0

<input type="button" value="Click Me"
       onclick="if (window.numclicks) numclicks++; else numclicks=1;this.value='Click # ' + numclicks;"/>
<form>
<input id="b1" type="button" value="Press Me"/>
<script>
function plead() {
      document.getElementById("b1").value += ", please!";
}
function unplead() {
      document.getElementById("b1").value = "Press Me";
}
document.getElementById("b1").onmouseover = plead; //set to function
document.getElementById("b1").onmouseout = unplead; //set to function
</script>
</form>

José M. Vidal .

43 of 66