Onclick redirect to a link instead of using a href

The following works fine for me, let me know if you need more.
HTML
<button id="promoCodeSubmit" onclick="ClickEvent()">Apply</button>
<input type="hidden" id="promoCodeValue" value="1"/>
JS
function ClickEvent(){
    window.location.href='http://www.test.com';
}

No comments:

Post a Comment