Answers for "how to add class to element when hover in javascript"

0

js add class when hover

<script>
  $(document).ready(function () {
    $(".box").hover(
      function () {
        $(this).addClass("box-hover");
      },
      function () {
        $(this).removeClass("box-hover");
      }
    );
  });
</script>
Posted by: Guest on August-29-2021

Code answers related to "how to add class to element when hover in javascript"

Browse Popular Code Answers by Language