Jonathan Wood Jonathan Wood - 4 months ago 11x
jQuery Question

Meaning of $get('0')?

I just upgraded to jQuery 1.12 from an older version. I'm going through the code, trying to resolve breaking changes.

One such change is occurring in the following code:

$(document).ready(function() {
function applciationUnloadHandler() {
var contactDropDown = $get('0');
createCookie('NewProgram_ContactID_Cookie', contactDropDown.value, null);

This code fails because

But I really don't understand what this is supposed to be doing. I don't see
defined anywhere. I can see from looking at the code behind that the
argument represents a contact ID, but I can't see what the code is supposed to be doing.


$get is a shortcut function for Sys.UI.DomElement.getElementById

The $get method provides a shortcut to the getElementById method of the Sys.UI.DomElement class.