Mubeen Hussain Mubeen Hussain - 1 year ago 75
jQuery Question

Making text bold in jQuery

I'm currently having a problem replacing the current text with the same text but in bold. I've tried the following

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

But I'm not sure why it doesn't work; 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