Tuesday, May 27, 2014

Hide current element using jquery

1) <script>
$(document).ready(function(){
  $("button").click(function(){
    $(this).hide();
  });
});
</script>

2) <h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>

3) This will hide only button

No comments:

Post a Comment