I am loading a content dynamically. The content is in html form and I need to get all of it's images and add a class to them. This is what I have done:
var jsonObj = JSON.parse(http_request.responseText);
console.log($(jsonObj.content).find("img").addClass("img-responsive"));
document.getElementById("myModalContent").innerHTML = jsonObj.content;
The console shows me that a class has been added but the DOM doesn't have that class. Why is it happening?