I have a website I would like to filter (not ER.org) using Greasemonkey. The structure of the html is as follows (simplified for this example):
<div class="a1">
{some stuff}
</div>
<div class="a2">
{some stuff}
</div>
Based on the occurrence of an URL within "a2" containing a string ("findString"), I would like to remove "a1" just prior to it.
var findDivs = $("div.a2 a:contains(findString)");
findDivs.parent().remove();
The above will remove "a2", but I can't seem to figure out how to remove "a1" instead. Any advice?
<div class="a1">
{some stuff}
</div>
<div class="a2">
{some stuff}
</div>
Based on the occurrence of an URL within "a2" containing a string ("findString"), I would like to remove "a1" just prior to it.
var findDivs = $("div.a2 a:contains(findString)");
findDivs.parent().remove();
The above will remove "a2", but I can't seem to figure out how to remove "a1" instead. Any advice?