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
echtgeld bonus sofort auszahlbar
My homepage: casino ohne limit mit bitcoin, Toolley.com,
wettquoten em spiele
Review my web page punkte wetten basketball
é casas de apostas em sistema (Joellen) limites
casas de apostas bonus sem deposito (Fran) desportivas
dicas
hoe winnen met weddenschappen
my web page :: promo wedden golf (Bernd)
bukmacher wypłaty na portfel
typing
gokken in delfzijl
Here is my site … 5 euro storten casino paysafecard
slots réels en ligne
Here is my site :: Casino neosurf 10 Euro
buenas apuestas Ganador f1 para hoy
golf Goede wedden sport
strategie
millenium legalny bukmacher w polsce efortuna
casino met welkomstbonus 2026
Stop by my blog post :: beste Goksite voor Belgen
resultado casa de apuestas por paypal apuestas deportivas
doble doble baloncesto Que Es Over En Las Apuestas
1 liga bukmacher
Here is my site: Milan wynik
Find a top upgrade wired clocks to wireless that is now available in addition at good rates now only!
apuestas en partidos de futbol en vivo real madrid
europa league Apuestas real madrid Athletic