Javascript getElementById() shortcut

Do you love the wonderful javascript dollar shortcut $('myId') but cannot use jQuery or Prototype? Don’t worry, you can define your custom shortcut for the too long document.getElementById() function:

function $(id) {
	return document.getElementById(id);

Now you can sobstitute this:

var divContent = document.getElementById('myId').innerHTML;

with this:

var divContent = $('myId').innerHTML;

Obviously you don’t get all the bells and whistles that you would get using jQuery, but it’s a start.