jQuery check if element has a specific style property defined inline

后端 未结 5 1772
隐瞒了意图╮
隐瞒了意图╮ 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:48

    Matthew you can check if style attribute is undefined or not

        var attr = $(this).attr('style');
        if (typeof attr !== 'undefined' ) {
       }
    

提交回复
热议问题