jQuery Selectors

0
12

jquery-javascript selectorsThe jQuery selectors are used to select and manipulate HTML elements based on their classes, id, types, attributes etc. These selectors start with the dollar sign and parentheses. For instance, $().

These are the following examples to select HTML elements based on:

 

Select HTML elements based on element name.

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

 

Select HTML elements based on id. It is used to select the particular html element in the page. This symbol(#) is used at the beginning id of the element just like in <button id="button" ></button>

$(document).ready(function(){
 $("#button").click(function(){
  $(this).show();
 });
});

 

Select HTML elements based on class. It finds elements with a specific class and a period is written at the beginning of the class name for selection just like in <button class="button" ></button>.

$(document).ready(function(){
 $(".button").click(function(){
  $(this).toggled();
 });
});

 

For all students who need programmer for your thesis system or anyone who needs a sourcecode in any programming languages. You can contact me @:

 

Email – [email protected]
Mobile No. – 09305235027 – tnt

Facebook Comments
(Visited 20 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here