Here’s a jQuery plugin I wrote that’ll add HTML5 <mark> tags around keywords or phrases in an element’s body text.
What is mark?
a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context
http://www.whatwg.org/specs/web-apps/
Usage
Add the script to your page, and then when the DOM is ready, do something like:
$('body').mark('Lorem ipsum');
The plugin can actually be used to wrap any tag around keywords. Simply pass the tag name you want to use as an option:
$('body').mark({ text: 'Lorem ipsum', tag: 'span', cssClass: 'mark' });
The above example will wrap span elements around the words lorem and ipsum. Each span element will have the class ‘mark’. View an example implementation.
TODO
- Input sanitation on the text to be marked. Currently the text is dumped straight into a regular expression. It needs to be escaped so that any regular expression meta-characters are interpreted as literals.
- Similarly, HTML special characters in the input need to be expanded into their HTML entities.
- From what I can see, IE doesn’t like <mark> tags, and seems to automatically self close the opening and closing tags inserted into the DOM. WTF? Can anyone shed any light on this problem? For now, you’re going to have to use a <span> with a CSS class
If you’re interested in contributing, get in touch
Hire a top seo wordpress that’s now available and with reasonably pricing now only!
Get the best best wordpress speed optimization service that’s now available and at reasonable prices now only!
Find the the top wordpress optimization currently now available and at reasonable prices now only!
Get the best wordpress seo training that is now available and on sale now only!
Get a top wordpress seo consultant that’s now available in addition with reasonably pricing now only!
Get the the top wordpress seo experts currently now available and at good rates now only!
Hire a top wordpress local seo that is now available and at good rates now only!
Hire a top wordpress seo audit currently now available in addition at good rates now only!
Get the best seo services for wordpress that is now available in addition with reasonably pricing now only!
Hire a top best seo for wordpress currently now available in addition with reasonably pricing now only!
Hire the best wordpress seo optimization service currently now available in addition at good rates now only!
Get a top wp optimization that’s now available and at good rates now only!
Hire a top wordpress speed optimization service that’s now available in addition at reasonable prices now only!
Find the the top wordpress optimize that’s now available and at good rates now only!
Hire a top wordpress seo consultant that is now available in addition at good rates now only!
Find the the top best wordpress speed optimization service that’s now available and at reasonable prices now only!
Get a top wordpress speed optimization service that’s now available and at good rates now only!
Hire the the top wordpress seo expert currently now available and with reasonably pricing now only!
Get the best wordpress optimize that is now available in addition with reasonably pricing now only!
Get the the top best seo for wordpress currently now available and on sale now only!
Find the best wordpress seo consulting that is now available in addition on sale now only!
Hire a top wordpress optimization services currently now available and on sale now only!
Hire a top wordpress seo optimization that’s now available in addition at reasonable prices now only!
Find the the top wordpress development services that’s now available and at reasonable prices now only!
Get the best wordpress local seo currently now available in addition on sale now only!
Find the the top wordpress seo experts that is now available in addition on sale now only!
Find the the top best seo for wordpress currently now available and at reasonable prices now only!
Get a top wordpress seo expert services that’s now available and at good rates now only!
Find a top wordpress local seo currently now available in addition with reasonably pricing now only!
Get a top wordpress seo experts that’s now available and at good rates now only!
Get the best on page seo wordpress that is now available in addition on sale now only!
Hire a top wordpress speed optimization services that is now available in addition at reasonable prices now only!
Hire the best wordpress speed optimization services that’s now available in addition with reasonably pricing now only!
Hire a top best seo companies for small businesses that’s now available in addition at reasonable prices now only!
Hire the best best wordpress speed optimization service that’s now available in addition at good rates now only!
Get the the top on page seo wordpress that is now available and with reasonably pricing now only!
Find the the top wordpress seo services that’s now available and with reasonably pricing now only!
Hire the best wordpress seo expert that’s now available and at good rates now only!
Hire a top wordpress development services currently now available and with reasonably pricing now only!
Get the the top local seo for wordpress that is now available and on sale now only!
Get a top optimizing wordpress that is now available and at reasonable prices now only!
Hire the best wp seo that’s now available in addition at good rates now only!
Hire the best wordpress seo service that’s now available and on sale now only!
Get a top wordpress optimize currently now available and with reasonably pricing now only!
Hire the best best wordpress seo currently now available in addition on sale now only!
Hire the best wordpress speed optimization services that is now available in addition with reasonably pricing now only!
Find a top wordpress seo expert services that is now available and at good rates now only!
Get a top wordpress seo that’s now available in addition with reasonably pricing now only!
Hire a top consultant seo wordpress that is now available and on sale now only!
Hire a top wordpress optimization services that is now available in addition with reasonably pricing now only!