Created
February 3, 2021 15:16
-
-
Save florianpasteur/049fc5107586f16dd6c415f14b3a37e8 to your computer and use it in GitHub Desktop.
Surprising Search & Replace in JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tag = "Some value"; | |
replacetag = '<span class="hightlighttag">' + tag + '</span>'; | |
console.log(textarea.value.split(tag).join(replacetag)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment