Over a million developers have joined DZone.

No More NULL Returned By GetElementById

// If you search for an ID that doesn't exist, getElementById(id) will return NULL, filling your error console with some stuff in it.

Now, everything is clear. No more error, no more NULL return. getElementById will now being silent for ever.

function GetID(id) { return (document.getElementById(id))?document.getElementById(id):false; }

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}