How to remove css attribute in js

Use document.getElementById(“objid”).className=”” to clear the style;

The className attribute sets or returns the class attribute of the element. You can love css styles more by changing the class attribute.

In some browsers (such as Chrome), it will return whatever value you assign to it. It is more painful in IE, it will format the output, capitalize the attributes, change the order of the attributes, and remove the last semicolon

Example:

  
  
    
    
    
    
    
    
    
    
    
  
  
  
    
      
      
        
          
             
        
        
           

Zhang San

WeChat ID: zhangsan

Department: Security Department

Information List add information
  • Message List 10
  • Message List 10
  • Message List 10
  • Delivery List 10
  • Notification List 10
  • Add information
  • Add a message
  • Add a comment
  • Add communication
  • Add notification

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/how-to-remove-css-attribute-in-js/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索