Hey all, I think I’m now comfortable enough to start writing about the basics of JavaScript. Though I will assume you know how to add JavaScript to a HTML page.
So here we are, the most handy thing of all: how to get a reference to an HTML element by the ID number.
document.getElementById('myElement');
This will find the HTML element with the ID of “myElement” .
here is some example HTML:
<html>
<head>
</head>
<script type="text/javascript">
<!--
function run()
{
alert(document.getElementById('myDiv'));
}
-->
</script>
<body onload="run()">
<div id="myDiv"></div>
</body>
</html>
Stay Cool!
-Bill



