Answers for "how i do class is active in javascript"

0

how to add active class to current element javascript

<script>
  function func(){
   document.getElementById('div').classList.add('active');
  }
</script>

<button onclick='func()'>Click</button>
<div id="div">
  This element gets 'active' class.
</div>
Posted by: Guest on June-16-2021
-1

set active element javascript

set active element javascript:

document.activeElement.blur();
Posted by: Guest on June-29-2021

Code answers related to "how i do class is active in javascript"

Browse Popular Code Answers by Language