I have a jquery that changes the text of a link like so:
if (urlfind > 0) {
$('#linkurl').text('More info');
}
And html:
<a href = "" id = "linkurl"></a>
I am trying to add bold to this link, but adding <b>More Info</b> leaves them escaped in the text itself, rather than making the text bold
.html() sets string as HTML content, whereas .text() sets the string as text.
Write:
if (urlfind > 0) {
$('#linkurl').html('<b>More info</b>');
}
OR
if (urlfind > 0) {
$('#linkurl').html('<strong>More info</strong>');
}
.html() .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