Highlighting Selected Words
2. Get the Script
Join the Discussion
More of this Feature
To be able to highlight the selected words on one of your web pages you first need to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called hilite.js.
You next attach the script into your web page that you wish to be able to highlight any of the words on by adding the following code into the head section of your page.
</script>
<style>
.hl {color:#f00;background-color:#ff0;font-weight:bold;}
</style>
You can of course put the style command into your own external stylesheet if you have one and can use whatever colour scheme that you like for the highlighted text colour scheme defined by the .hl line in your stylesheet.
With this code attached into the head of your web page you can then pass a query string indicating the words to be highlighted using whatever method that you like to generate the ?hilite= on the end of the address of your page.

