document.getElementById() is the most common used construct by a Javascript programmer. Most of the APIs have generalized a common method to use this construct. Here is how and what needs to be included on your page.

It is very simple technique, define a function with very short name to return the object be using the above construct. This way we can reduce the page weight as well.


<script type="text/javascript">
function $(id)
{
return document.getElementById(id);
}
</script>


Use the $ function wherever you would like to get the object based on the id. $('x') would return the object reference of the page element which has the id "x".