Mubeen Hussain Mubeen Hussain - 3 months ago 29
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?


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 />");