I have a tree that is inside a <div>
tag (id: treePanel).
This tree is actually a bunch of <ul> and <li>
tags that are nested in several levels (<ul>
tag inside another <ul>
tag and so on.
I need to find a node in this tree (one of the <li>
tags) that has a specific text and update it. How can I do this using jQuery?
Example:
<div id="treePanel">
<ul>
<li> root 1</li>
<li> root 2</li>
<li> root 3
<ul>
<li> leaf1</li>
<li> leaf2</li>
<li> find me</li>
</ul>
</li>
</ul>
</div>
I need to find a node in this tree (one of the tags) that has a specific text and update it
Use :contains
Docs filter selector:
$('#treeID li:contains("your text")').......
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