Home - xurion/acronymizer.js GitHub Wiki
Acronymizer.js is a native JavaScript class that wraps pattern-matched text in HTML with an element (acronym by default). This solves the issue of directly modifying the innerHTML of an element and unbinding any events that have been bound.
This example shows a simple way to wrap all occurrences of the text "CSS" and wrap it.
window.onload = function () {
var body = document.body,
acron = new Acronymizer({
element: body,
pattern: 'CSS'
});
acron.go();
};
See examples for more advanced uses.