Need help with hrjs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

mburakerman
410 Stars 22 Forks MIT License 24 Commits 3 Opened issues

Description

🔄 Tiny JavaScript plugin for highlighting and replacing text in the DOM

Services available

!
?

Need anything else?

Contributors list

No Data

HR.js

Tiny JavaScript plugin for highlighting and replacing text in the DOM

Install

NPM

Include hr.js file:

html

or use CDN:
html

Usage

Lorem ipsum dolor sit amet.

Activate


That's it!

CodePen demo

CodePen demo

Multiple

You can also highlight and replace multiple keywords.

I love JavaScript.


CodePen Multiple demo

Highlight example

To highlight only, just add your keyword to

highlight
option.

Lorem ipsum dolor sit consectetur amet.

Consectetur enim ipsam voluptatem quia


CodePen Highlight demo

Customize

These are default options.

new HR("elem", {
  highlight: null,
  replaceWith: null,
  backgroundColor: "#FFDE70"
}).hr();

Support

  • IE 10+
  • Chrome
  • Firefox
  • Safari
  • Opera

License

Licensed under the MIT License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.