JS Newbie, how to approach this problem?

Hey guys,

Have had very little exposure to JS.

I am currently looking to load a a href="link" when a user clicks on a button more than once

Button code is currently

<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="button"><span class="button-cart-text"><?php echo $button_cart; ?></span></button>

Not sure where to start

Actually come to think of it, it’s probably better to load a page after a 1 sec has past

Found this JS but how do I trigger it when an alert class is displayed?

setTimeout(openUrl, 5000); // Wait 5 seconds

function openUrl(){

 window.open('http://google.com');

}

So you have a button and when a user clicks on it twice, you want to load a second page with a one second delay. Did I get that right?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.