Hello, I want js code to open new tab on 2nd click. I have a code. On first click it opens a new tab but after 3 second a new tab automatically opens. I want to open 2nd tab also on click after 3 seconds, not automatically. Here is my code:
<script>
$(window).one('click',function() {
var url = "https://google.com";
window.open(url, "_blank");
setTimeout(function(){ window.open(url, "_blank")}, 3000);
})
</script>
<script>
$(window).one('click',function() {
var url = "https://google.com";
window.open(url, "_blank");
setTimeout(function(){ window.open(url, "_blank")}, 3000);
})
</script>
Comment