mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
27 lines
741 B
TypeScript
27 lines
741 B
TypeScript
|
|
|
|
|
|
|
|
$('#content').highlight('lorem');
|
|
|
|
// search for and highlight more terms at once
|
|
// so you can save some time on traversing DOM
|
|
$('#content').highlight(['lorem', 'ipsum']);
|
|
$('#content').highlight('lorem ipsum');
|
|
|
|
// search only for entire word 'lorem'
|
|
$('#content').highlight('lorem', { wordsOnly: true });
|
|
|
|
// don't ignore case during search of term 'lorem'
|
|
$('#content').highlight('lorem', { caseSensitive: true });
|
|
|
|
// wrap every occurrance of term 'ipsum' in content
|
|
// with <em class='important'>
|
|
$('#content').highlight('ipsum', { element: 'em', className: 'important' });
|
|
|
|
// remove default highlight
|
|
$('#content').unhighlight();
|
|
|
|
// remove custom highlight
|
|
$('#content').unhighlight({ element: 'em', className: 'important' });
|