Computer Science, asked by kondurusrikantp77wnd, 1 year ago

In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you

that ?

Answers

Answered by Anonymous
0
For this you need to add JavaScript, with HTML only it is not possible. Below os the javascrpt solution.

Add below code in your HTML file

<button id="btn">Visit Google</button>

Add below code in your javascript file or add it in your HTML file within script tag.

  const btn = document.getElementById('btn');
  function openGoogle() {    window.open('https://google.com');  }
  btn.addEventListener('click', function(){    setTimeout(openGoogle, 15000);  });

Now if you will open your html file in browser you will see a button with "open google" text

When you will click that button google will get open in new tab after 15 seconds.
Similar questions