Skip to content

Challenge Target The Same Element With Multiple JQuery Selectors

Quincy Larson edited this page Aug 20, 2016 · 1 revision

Challenge Target the same element with multiple jQuery Selectors

The multiple jQuery selectors are:

  1. By type: $("button")
  2. By class: $(".btn")
  3. By id: $("#target1")
<script>
  $(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("shake");
    $("#target1").addClass("btn-primary");
  });
</script>
Clone this wiki locally