I have four article tags in my html page with the class col. Inside each article I have a div with the class heading. Inside of that I have an img tag.
I'm trying to iterate through each artcle and remove that image tag and replace with some different html.
This in Wordpress, hence the funky jquery function wrapper.
Right now im just trying to get the finding and replacing working (below) - I haven't attempted the different code for each article bit yet. I can't figure out why the below doesn't work.
(function ($) {
$(document).ready(function() {
$('article.col').each(function(el) {
$((el).find('heading img').replaceWith('<newtag>somecode</newtag>'));
});
});
}(jQuery));