I'd like to hide the <div id="sociallocker">
if the word: email appears in the URL. And show the <div id="emaillocker"> if it does appear.
I've tried the following but no luck:
<script type="text/javascript">
$(function () {
if (window.location.href.indexOf("email") != -1) {
$("#sociallocker").hide();
}
});
</script>
HTML
<div id="sociallocker">
[sociallocker id="1505"] [/sociallocker]
</div>
<div id="emaillocker">[emaillocker] [/emaillocker]
</div>
I am running Wordpress with JQuery & Bootstrap on the Genesis Framework. Not sure if I need to add anything else to the JQuery to get it to fire?
Live test: https://www.moneynest.co.uk/test-page-for-stack/
Sam