Can someone explain whats happening in the followong lines of code, taken from the application attached..
var $ = function ( id ) {
return document.getElementById( id );
}
$("btnDisplay").onclick = display_click; // In particular, what is going on here??
Thanks
head><title>JavaScript Event Handler</title><script type="text/javascript">// This function receives an id and gets the related XHTML object.var $ = function ( id ) {return document.getElementById( id );}var display_click = function () {alert( "You clicked the button.");}window.onload = function () {$("btnDisplay").onclick = display_click;}</script></head><body><p><input type="button" value="Display Message" id="btnDisplay" /></p></body></html>