Highlighter - Highlights the selected text.
Author - Harshita Kasera
License - MIT
Introduction
Highlighter is a pure javascript plugin that lets you highlight the text selected through mouse. There is a jQuery version for the same with customizable options.
Demo
Click here to see a working demo of the javascript plugin.
Click here to see a working demo of the jQuery highlighter plugin.
Installation
For javascript version just include the file highlighter.js
<script src="highlighter.js"></script>
<link rel="stylesheet" href="highlighter.css" />
For jQuery version you need to add jQuery and the jQuery highlighter plugin and select the target as below :
<script src="jquery.js"></script>
<script src="highlighter-jquery.js"></script>
<link rel="stylesheet" href="highlighter.css" />
$("#target1").highlighter({
highlighted: "highlighter-y" // Specify the class name for the highlighted element
});
$("#target2").highlighter({
highlighted: "highlighter-g" // Specify the class name for the highlighted element
});