I am creating a comparison that will do the following, if the address is www.google.com will perform the function otherwise it will remove. I am with this script but I am not able to mount the else.
if (window.location.host == 'http://www.google.com.br') {
var optinBtn = document.querySelector('#newsletterButtonOK'),
clickFnc = document.querySelector('#newsletterButtonOK').onclick;
window.optinHandler = function () {
Bat.cookie.set('allin-optin', document.querySelector('#newsletterClientEmail').value, 60);
clickFnc();
};
optinBtn.setAttribute('onclick', 'window.optinHandler()');
}
else {
}