jQuery check if element has a specific style property defined inline

后端 未结 5 1780
隐瞒了意图╮
隐瞒了意图╮ 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 08:06

    Checking for "width" for example:

    if ($(element).prop("style")["width"] !== '')
    {...}
    

提交回复
热议问题