jquery - Removing a parent row if a specific value is found -
I have a table without a specific class or id, and I like to remove those table rows within which the link is Inside that table, a specific attribute value (href * = ...), or for that matter, anywhere on the web site. I can get rid of links, but that line is not inside that line. How can I do this with CSS? If not, with jQuery or JS?
There is no CSS parent selector, so it is not possible to css alone.
You can do this with jQuery very easily, however, using attribute selectors:
$ ('table a [href = somethingSpecific]'). Removing the closest ('TR'). Or, you can select all your anchors and filter them (faster): $ ('table a'). Filter (function () {return $ (this) .attr ('href') == 'something special';}). Closest ('tr'). Remove ();
Comments
Post a Comment