Write a keyword (search string) in the search field to highlight text in the blue section and tab through the highlighted items!
This script highlight keywords in HTML web applications or sites. It was developed for and is best used with small to medium size length of HTML text content. The highlighted items can then be tabbed through.
This piece of code was initially created in an another project to highlight keywords in AJAX search results. This script does not pretend to be perfect, please contribute if you feel something is wrong.
<!-- HTML -->
<script src="path_to_your_file/txtHighlither.js"></script>
// JS
var targetID = "target";
<!-- HTML -->
<input id="custom-search-field" class="custom-search-field" type="text" name="search" placeholder="Custom Search Field" tabindex="1"/>
// JS
var inputID = "custom-search-field";
Anyone and everyone is welcome to contribute.
Note: I know very little about Javascript. I just started to learn it couple weeks ago. I am always looking for constructive feedback, learning buddies and or opportunities! Learning material: Thanks to Eloquent JavaScript and the MDN - Mozilla Developer Network
| SPIRIT WITHOUT MORNING | IMAGE HAVE FOWL | EVENING VERY FLY |
|---|---|---|
| spirit without morning | image have fowl | evening very fly |