jQuery check if element has a specific style property defined inline

后端 未结 5 1788
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 07:19

I need to check whether an element has a defined css property given to it, but I\'m having some trouble using the jQuery.css() function.

The property I\'m looking fo

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 07:50

    Why not just:

    var $el = $('element[style*="width"]');
    

    And then you can test it with:

    if ( $el.length ) {
        //...
    }
    

提交回复
热议问题