This function declaration doesn’t make sense to me. What does the $ sign do?
function $(id) { return document.getElementById(id); }
Also, this code is interfering with other Javascript code. If I comment it out, then the other Javascript code I’m trying to use works, but then I lose some other functionality.
Why might it be interfering with my other code.
You are declaring a function called
$that wrapsdocument.getElementById, apparently for convenience. Nothing special.Reference What characters are valid for JavaScript variable names?
As for the interference, there is likely another global variable called
$, which is being clobbered. See jQuery.