I have got a jQuery var that contains HTML that I'm appending to a page.
I need to remove a HTML element before I append it to the page but I can't seem to filter it.
for example the variable contains;
<div class="block1"></div>
<div class="block2"></div>
I have tried filtering like this before I append:
var mydata = $(mydata).filter('.block1');
and
var mydata = mydata.filter('.block1');
but none of these work. Any suggestions?
mydatais already set somewhere? Have you tried$("div").filter('.block1').remove();or perhaps$("div").filter(return $(this).hasClass(".block1")).remove();?