Created
May 4, 2023 18:54
-
-
Save coulterpeterson/5f88737c556e699f4bae995b5f5814e2 to your computer and use it in GitHub Desktop.
Conditionally Hide A Gravity Forms Post Content Merge Tag Based On Its Value
This file contains hidden or 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
<div id="timekeeping-solution">{Are you interested in a timekeeping solution that would allow employees to easily clock in and out online?:22}</div> | |
<script> | |
// When the page is ready | |
window.addEventListener('load', function () { | |
if (document.querySelector('body') !== null) { // Some element that should be rendered by now before we execute code | |
const timekeepingSolution = document.querySelector('#timekeeping-solution'); | |
if( timekeepingSolution.innerHTML == "No" ) { | |
timekeepingSolution.style.display = "none"; | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment