Help me with an onClick snippet?

Hi, just want to point out that the whenClicked snippet (from 2016) is using eval() that is usually considered dangerous and best avoided so you don’t accidentally allow malicious code injection on your site, see eval() - JavaScript | MDN!

I was able to add a custom onClick just by using the Custom Code settings. Set the ID of your element then add something like this to the Footer code.

<script type='text/javascript'> 
document.getElementById("nav-contact-button").onclick = function() {
 //do something, for example
 CustomContactPopup.show();
}
</script>