I am parsing a html string fragment and changing the src attribute of image tags. (i.e. replacing paths that start with ".."
var hstr = $.parseHTML(str);
$(hstr).find('img').each(function(e){
var srcvalue = $(this).attr('src');
srcvalue = srcvalue.replace(/../gi, "");
$(this).attr('src', srcvalue);
});
then setting the contents of a div element by appending the result
document.getElementById('#section').append($(hstr));
but it is not working... can anyone tell me what is going wrong ?