jQuery Selectors - Tutorial

Onclick function on jQuery


Onclick function hide/show by id="" the below are the example

$(document).ready(function(){
     $("#IamOne").click(function(){
          $(this).hide();
     });
});
Click on below text

Click me to hide

Onclick function two id's in single function


Onclick function hide by id="" with single function the below are the examples

$(document).ready(function(){
     $("#UamOne, #UamTwo").click(function(){
          $(this).hide();
     });
});

Click on below text

Click on me iam id one

Click on me iam id two

Onclick function show id onclick


$(document).ready(function(){
     $("#ShowME1").click(function(){
          $("#SubCategr").show();
     });
});

Click and see what happens

Post a Comment