Answers for "jquery select by clas, by id, by element"

1

jquery select by clas, by id, by element

<p id="test" class="hello">Hello</p>

<script>
  //Hide "p"
  $("p").hide();
  //Hide id="Test"
  $("#test").hide();
  //Hide all class="hello"
  $(".hello").hide();
  //Hide all "p" with class="hello"
  $("p.test").hide();
</script>
Posted by: Guest on October-19-2021

Browse Popular Code Answers by Language