How can I add and remove an active class to an element in pure JavaScript

前端 未结 9 1162
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 20:29

I am trying to make a navigation menu I did all the HTML and CSS when come to javascript I am struck in the middle I am able to add a class to the

9条回答
  •  温柔的废话
    2020-12-17 20:56

    you can do like this in pure javascript

       function myFunction(e,ev) {
          for(var i=0;i
    
        
        
            Navigation class Toggling
    
            
        
        
        

提交回复
热议问题