Below, I have a piece of javascript code.
var htmlBlurb = '<div> hello <font color=red>world</font>!!!</div>';
$(htmlBlurb).find('font').each(function(e){
$(this).html("Javascript");
});
console.log(htmlBlurb);
I am expecting the output in htmlBlurb as
<div> hello <font color=red>Javascript</font>!!!</div>
But htmlBlurb
is not changed.
Can someone explain what am I missing here?