-
-
Save malditojavi/c185ff0fc608b23f8d9b28cb4a297ab8 to your computer and use it in GitHub Desktop.
Hack Price Match 5
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
function isSelectedText(txt) { | |
return window.getSelection().toString().trim() === txt; | |
} | |
function DoThisWhenTextIsSelected() { | |
// If text selected is equal to our product name | |
if (isSelectedText(document.getElementById("productname").textContent)) { | |
// show our cta | |
document.getElementById("hiddencta").className = "visibleCTA"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment