$("#Ctl1_txtMyTextBox").change(...);FWIW, in the past I've used a function that helps me with this:
$$ = function (id, context) { /// <summary> /// Searches for an ID based on ASP.NET naming container syntax. /// First search by ID as is, then uses attribute based lookup. /// Works only on single elements - not list items in enumerated /// containers. /// </summary> /// <param name="id" type="var">Element ID to look up</param> /// <param name="context" type="var"> /// </param> /// <returns type="" /> var el = $("#" + id, context); if (el.length < 1) el = $("[id$=_" + id + "],[id*=" + id + "_]", context); return el; };You can then use it like this:
$$("txtMyTextBox").change(function() { alert('exit') });and it'll find anything that matches this name regardless of the WebForms container prefixes.
><script type="text/javascript"> > $(document).ready(function () { > > $("txtMyTextbox").change(function () { > > alert("Change Function Called"); > > }); > > }) ></script> >>