jQuery find by inline css attribute

后端 未结 8 1882
深忆病人
深忆病人 2020-12-06 00:14

I need to find an element based on a specific css attribute. The css is applied inline and I can not use a class. Is there anyway to achieve this i

8条回答
  •  猫巷女王i
    2020-12-06 00:32

    Something like:

    $('selector').each(function() {
        if($(this).attr('style').indexOf('font-weight') > -1) {
            alert('got my attribute');
        }
    });
    

提交回复
热议问题