Reputation: 97
I used mark.js to highlight some words that i want in a string. But for some weird reason , it's not highlighting all the words i want.
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/7.0.0/mark.min.js"></script>
<body>
<div>Hyundai Samsung car jeeps jeep jeep jeep Mercedes-Benz Nike Apple Nissan Scion!</div>
</body>
<script>
var brands = ["car" , "jeeps" , "jeep"];
var instance = new Mark(document.querySelector("body"));
instance.mark(brands, {
accuracy: "exactly",
separateWordSearch: false
});
</script>
</html>
Upvotes: 0
Views: 514
Reputation: 97
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.es6.js"></script>
inclusion of this cdn made it work.
Upvotes: 1