gEle:
shortcut for document.getElementById

Shortcut for the document.getElementById function, it helps to reduce the code and is easier to remember than the full name.

Code

gEle = function(a){
	return ( (typeof a==="string") ? document.getElementById(a) : a );
};

Parameters

a (string of text or object)
The string with the id of the object or one DOM object, this second option is for the use with jQuery

Returned value

The DOM object with the given id or null if not exist

Leave a Reply

Your e-mail address will not be published. Required fields are marked *