$('#<%= txtFirstName.ClientID%>').show();
Trying to send ClientId to external Javascript file using server tags
as a parameter
<input type="text" ID="txtFirstName" runat="server" maxlength="50"
class="DefaultTextbox" style="width:180px;"
value="First Name"
onfocus="ControlOnFocus('First Name',$('#<%= txtFirstName.ClientID%>').show())"
onblur="ControlOnBlur('First Name')"/>
function ControlOnFocus(CompareString,ControlId)
{
alert(ControlId);
}
$()is a short alias for the main jQuery function, also calledjQuery(). You pass it a CSS selector, and in CSS,#means “the HTML element with ID…”. That ID is in the ClientID variable in this program, apparently. Theshow()call then makes the named HTML element appear.