Mubeen Hussain Mubeen Hussain -4 years ago 107
jQuery Question

Replacing text to bold in jquery

I am currently having a problem replacing current text with the same text but in bold. I have tried the following but not sure where i am going wrong:

var valueInRow = $(value).closest(".label.imaged").text();
var result = valueInRow.bold();

Any ideas?

Answer Source

You can clearly use .wrapInner():

Wrap an HTML structure around the content of each element in the set of matched elements.

$(value).closest(".label.imaged").wrapInner("<strong />");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download