removing complete table row without specefic class
|
|
Hi,
i want to remove all table rows with this code inside |span class="PhorumListSubjPrefix">Sticky: |/span>code here: <tr>
<td class="PhorumTableRowAlt">
I tried alot. Regex, ...
But i dont get it.
var ad = $x("//span");
var i = 0;
for(i;i<ad.length;i++)
ad[i].parentNode.removeChild(ad[i]);
?!
Can you please help me :)
Thx
|
|
|
Well you could do it with a more sophisticated Xpath expression which I don't have the time to write right now. But it would involve spans containing that class with TR ancestors. This is hackish but I think would work if the structure is always the same...
ad[i].parentNode.parentNode.parentNode.removeChild(ad[i].parentNode.parentNode)) // ad's 3rd parent is the TR's parent, 2nd parent is the target TR |
|
|
If the parent structure is for each span with class of "blah" return the parents parent(TR) All the above was of the top of my head - but I think it's right :wink: |
|
|
Hi thx for your response. But both dont work, it happens nothing. It is possible that there is something missing? You could test it on this Website www.busfreunde.de Greetings |
|
|
what about something like;
|
|
|
Shouldn't have tried it off the top LOL. This works....
|
|
|
Yeah. it works. Thank you :) |
|
|
I was going to correct you, but you got it!
|
|
|
And you don't need to check both |

