0
I want to change a text that appears before a span with Jquery, this text will be changed when some user renames a folder.
<li>
<a href="#">
Pasta 1
<span class="tag tag-pill tag-danger" id="spanPasta1">0</span>
</a>
</li>
When I change using the code below, the span is deleted.
$("#spanPasta1").closest('a').text('pasta 2')
I want to change the text without having to change all the CSS code and take the span out of the href.
These two examples I didn’t know, I was trying to find a solution.
– NoobSaibot
The solution $("#spanPasta1"). Closest("a"). Contents(). first()[0]. textContent = "folder 2"; functioned perfectly :)
– RRV