What I need is to replace the text of a button
. I want to replace the word SUCURSAL
.
<button id="btnSucursal" type="button" class="btn btn-danger dropdown-toggle"
data-toggle="dropdown">
<i class="fa fa-map-marker fa-lg" aria-hidden="true"></i>
SUCURSAL <span class="caret"></span>
</button>
The problem is that within the text I have an icon and a span
that I would not like to lose.
So far, I have replaced all the text of the button:
$('#btnSucursal:contains("SUCURSAL")').text("hola");
I need to replace the text, without losing:
<i class="fa fa-map-marker fa-lg" aria-hidden="true"></i>
nor
<span class="caret"></span>