Possible Duplicate:
How do I add a DOM element with jQuery?
var re = new RegExp("\\b(" + l + ")\\b")
var sOpen = "<span class='highlight'>";
var sClose = "</span>";
var newhtml = sp.replace(re, sOpen + l + sClose, "gi");
alert(newhtml);
$('.highlight').css('color', 'yellow');
I am getting newHtml value as
I love to work with <span class='highlight'>jquery</span>
I am highlight the highlight class item. jquery but its not hightlighting the text. please can any body tell me is that something I am doing wrong here?
how to create a newhtml as DOm element?
thanks