Social Icons

Sunday, February 3, 2013

How can u work by class selector?


Now i will teach how can jquery work by class selector...

Syntax:

 $(". class name").hide()


Now just copy this code on notepad and see....

<!DOCTYPE html>
<html>
<head>
<script src="jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $(".test").hide();
  });
});
</script>
</head>
<body>

<h2 class="test">This is a heading</h2>
<p class="test">This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>

<< Previous || Next >>

No comments:

Post a Comment