DEV Community

loading...

Discussion on: Highlight text in JavaScript

Collapse
equinusocio profile image
Mattia Astorino

Please use the correct markup. A span is not appropriate and the <mark> is the HTML element you should use for text highlighting

Collapse
tomekdev_ profile image
🤓 Tomek Nieżurawski Author

Nice one! I didn't even know <mark> exists 🤭 Thanks Mattia!