removing html element styles via javascript

前端 未结 8 605
没有蜡笔的小新
没有蜡笔的小新 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");
    

提交回复
热议问题