getElementById()

The getElementById() method allows you to access an element by the value of its id attribute.

<div id="MyDiv">
Content goes here.
</div>
<script>
var FirstDiv = getElementById("MyDiv");
</script>

You can make you of an event that occurs on this element and script a reaction to the event.

Leave a Reply