Adding and removing style attribute from div with jquery

前端 未结 7 2015
走了就别回头了
走了就别回头了 2021-01-30 00:53

I\'ve inherited a project I\'m working on and I\'m updating some jquery animations (very little practice with jquery).

I have a div I need to add and remove the style at

相关标签:
7条回答
  • 2021-01-30 01:24

    To completely remove the style attribute of the voltaic_holder span, do this:

    $("#voltaic_holder").removeAttr("style");
    

    To add an attribute, do this:

    $("#voltaic_holder").attr("attribute you want to add", "value you want to assign to attribute");
    

    To remove only the top style, do this:

    $("#voltaic_holder").css("top", "");
    
    0 讨论(0)
提交回复
热议问题