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 -

how does one get csharp-sqlite to throw exceptions for duplicates or foreign key constraint violations -

Simple Angular 2 project fails 'Unexpected reserved word' -