What do we mean by #id Selector?

 Posted by vishalneeraj-24503 on 6/9/2014 | Category: jQuery Interview questions | Views: 509 | Points: 40
Answer:

The jQuery #id selector is nothing but a controlID which uses the id attribute of an HTML tag to find the specific control.It must be unique on a page.
We have to use # sign followd by ControlID yo find control usng jQuery.

Syntax:-
$("#anyControlID")
For Example:-
<asp:Button ID="btnDelete" runat="server" Text="Delete"/>

<asp:Button ID="btnSave" runat="server" Text="Save"/>

$(document).ready(function(){
$("button").click(function(){
$("#btnDelete").hide();
});
});


Here,on clicking of save button,Delete button will be hidden.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response