jquery - Target all Divs with Certain Style -


how can target divs in page have margin-left: -15px; margin-right: -15px; , assign margin: 0, without knowing name of class?

i thinking div[style="margin-left: -15px;"][style="margin-right: -15px;"] doesn't work since styles not applied inline.

the option iterate through elements, margin , compare values.

var allelements = $("*"); for(var e=allelements.length-1; e>=0; e--){    var elem = allelements.eq(e);    if(elem.css("margin-left") == "-15px"){       //do    } } 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -