how to remove highlight from only one selection using mark.js
Use className
parameter to mark/unmark a group
https://markjs.io/#parameters
function highlightArrowsOnCheck() {
var instanceArrows = new Mark(highlightedParagraph);
var options = {
"className": "arrows", // added
"debug": true,
"log": window.console
};
if (checkedArrows.checked) {
instanceArrows.markRegExp(/\«|»/g, options);
} else {
instanceArrows.unmark(options);
}
}
Working Demo
Note: togglecheckall
function is simplified by triggering event programmatically.