How to remove width attribute which is under style attribute using jQuery?

前端 未结 7 1268
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 12:40
TEST TEXT

How to remove width attr

相关标签:
7条回答
  • 2021-02-01 13:00

    A slightly-shorter version of the accepted answer:

    .width('auto')
    
    0 讨论(0)
  • 2021-02-01 13:05

    You can do that with CSS only:

    div[style="position: absolute; top: -136px; overflow: auto; width:1241px;"] {
    width: 0px !important;
    display: none !important;
    

    }

    0 讨论(0)
  • 2021-02-01 13:07

    Don't use inline styles. Use classes.

    $(".views").removeClass("a");
    $(".views").addClass("b");
    

    But if you really want to, you could do the following:

    $(".views").css("width", "");
    
    0 讨论(0)
  • 2021-02-01 13:13

    You could use:

    .css('width', 'auto')
    
    0 讨论(0)
  • 2021-02-01 13:13

    I think you must try this:

    $(".views").removeAttr('style').attr('style','position: relative; height: 15px; overflow: hidden;');

    0 讨论(0)
  • 2021-02-01 13:22

    As easy as

    $('div.views').css('width', '');
    
    0 讨论(0)
提交回复
热议问题