Select Element By CSS style (all with given style)

前端 未结 4 1212
无人共我
无人共我 2020-12-09 13:44

Is there a way to select all elements that have a given style using JavaScript?

Eg, I want all absolutely positioned elements on a page.


I would assume

4条回答
  •  一整个雨季
    2020-12-09 14:11

    For Mootools:

    var styleEls = $$('*').filter(function(item) {
        return item.getStyle('position') == 'absolute';
    });
    

提交回复
热议问题