dimanche 19 avril 2015

How to Add class to all images inside div using jQuery?

Inside div I am dynamically loading inner text and it also contains img tags. After rendering dynamically I want to add class to all images present insdie that div.


I have tried this but its not working for me.


src of every img tag inside div is starting from data:image



function loadDiv() {

// loading successfully div elements

$("img[src*=data:image]").addClass("img-responsive");


}

Aucun commentaire:

Enregistrer un commentaire