Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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>
Comment

Adding active Class with JavaScript

$("#navMenus").on('click','li',function(){
     $(this).addClass("active");  // adding active class
});
Comment

PREVIOUS NEXT
Code Example
Css :: how to change line colors in css 
Css :: switch css with text 
Css :: grid-container div 
Css :: css border image repeat property 
Css :: how to change bootstrap page link pagination 
Css :: enlarge icon when hover 
Typescript :: typescript disable next line 
Typescript :: expected 2 arguments but got 1. viewchild angular 
Typescript :: mongodb exists and not null 
Typescript :: dev/storage/logs" and its not buildable: Permission denied 
Typescript :: Listing available com ports with Python 
Typescript :: how check is file exist linux 
Typescript :: open two modal in chakra ui 
Typescript :: convert string to uppercase typescript 
Typescript :: yarn.ps1 cannot be loaded because running scripts is disabled on this system 
Typescript :: leaderstats roblox setup 
Typescript :: count li elements jquery 
Typescript :: how to add new index in array in typescript 
Typescript :: router.navigate angular 
Typescript :: serenity.is disable row in grid 
Typescript :: adonis load many 
Typescript :: check if string include numbers in typescript 
Typescript :: react native status bar iphone 12 
Typescript :: if exists certain line in sql table java condition 
Typescript :: list of american tanks 
Typescript :: azure artifacts npm install latest version not updating 
Typescript :: what is the purpose of interrupts in os 
Typescript :: css all inoputs not checkbox 
Typescript :: remote events client to server lua 
Typescript :: colorize brackets vscode 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =