🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

seekAndWrap is a jQuery plugin which searches characters in your text and wrap them in a container element with custom CSS classes and HTML attributes.

text-highlighting

Documentation

seekAndWrap

seekAndWrap is a jQuery plugin to find a text in a given element and wrap it with a tag and attributes in parameter in order to use it in useful cases.

Example :

<div id="container">   HTML and JS are the best languages ever... </div>
$("#container").seekAndWrap({ 	"search" : "js", 	"tag" : "span", 	"class" : "keyword", 	"attribs" : [ 		{"title" : "JavaScript"}, 		{"data-desc" : "JavaScript is a client side language."} 	], 	});

That way you will get :

<div id="container">   Html and <span class="keyword" title="JavaScript" "data-desc"="JavaScript is a client side language.">JS</span> are the best languages ever... </div>

DEMO

Check this demo page


You May Also Like