the following code I have written for inline styling, instead of that i need to provide the class from from different .css file using jquery .addClass method. How Can I do that?
$(keywords).each(function(){
var pattern = new RegExp("("+this+")", ["i"]);
var rs = "<span style='background-color:#FF6666;font-weight:bold'>$1</span>";
if(el.length > 0){
el.html(el.html().replace(pattern, rs));
}
});
keywords,elin your code.