I'm tryting to use the JQuery to find and remove the <li>
<a href="/arb/node/53/grouping/edit/">Edit group</a>
</li>
with no luck at all.
Could please let me know to achieve this.
<ul class="tabs secondary">
<li class="active">
<a href="/arb/node/53/grouping">View</a>
</li>
<li>
<a href="/arb/node/53/grouping/add">Add new Group</a>
</li>
<li>
<a href="/arb/node/53/grouping/edit/">Edit group</a>
</li>
</ul>
I try the following jquery, but it not work.
$(".tabs.secondary:contains(\"Edit group\")").remove()
The right solutions should be something that will find the word "Edit group" and remove it <li>
parent.
Thanks
Finau
$("li:has('a'):contains('Edit group')").remove();
Demo: http://jsfiddle.net/YqFfe/
If you are using jQuery:
$('.tabs li:has(a[href="/arb/node/53/grouping/edit/"])').remove()
to remove it.
jsfiddle
reference
Edit: since the number in the path is dynamic, you can probably use the following:
$('.tabs li:has(a[href$="/edit/"])').remove()
which will only remove the URL path that ends with /edit/
.
new jsfiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With