removing html element styles via javascript

前端 未结 8 569
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 20:34

I\'m trying to replace an element\'s inline style tag value. The current element looks like this:

`

        
相关标签:
8条回答
  • 2020-12-07 21:02
    getElementById("id").removeAttribute("style");
    

    if you are using jQuery then

    $("#id").removeClass("classname");
    
    0 讨论(0)
  • 2020-12-07 21:09

    you can just do:

    element.removeAttribute("style")
    
    0 讨论(0)
提交回复
热议问题