Find control with CSS class

jQuery provides a very cool mechanism to find the control of the page with the class name. Let's say you want to find out all the a tags which are having "sample" as Css class. jQuery has really made life simple for programmers.

Below given code does exactly the same thing. It also adds the click event to every a tag.

$(document).ready(function() {
 $("a.sample").click(function(){
     alert('clicked');
  });
});

Feel free to contact me for any help related to jQuery, I will gladly help you.



Responsive Menu
Add more content here...