-2
<div class="navbar">
  <a>
    <div class="grid__item theme-1">
      <button class="action"></button>
      <button class="particles-button">Home</button>
    </div>
  </a>
</div>

In this Effect applied how can I redirect it after the effect completed?

SparkFountain
  • 2,110
  • 15
  • 35
  • Possible duplicate of [How to create an HTML button that acts like a link?](https://stackoverflow.com/questions/2906582/how-to-create-an-html-button-that-acts-like-a-link) – Sinto Sep 06 '19 at 06:42
  • 2
    Please show some effort into the question, there is a lot of answers to the same question. One usage is: `onclick="location.href='http://google.com';"` – Sinto Sep 06 '19 at 06:44
  • 2
    Welcome to StackOverflow. Please start your question with a question - that's why it is called a question. An uncommented piece of code does not really help the community to understand what you would like to achieve. – SparkFountain Sep 06 '19 at 06:44
  • Possible duplicate of [How can I make a button redirect my page to another page?](https://stackoverflow.com/questions/16562577/how-can-i-make-a-button-redirect-my-page-to-another-page) – Sinto Sep 06 '19 at 06:46

3 Answers3

-1

Just add an onclick event to the button:

<button onclick="location.href = 'www.anysite.com';" id="buttonID" class="particles-button" >Home</button>

and other way is

<button class="particles-button" id="buttonID" >Home</button>

<script type="text/javascript">
    document.getElementById("buttonID").onclick = function () {
        location.href = "www.anysite.com";
    };
</script>
Tapan Dave
  • 273
  • 3
  • 16
-1

It is better to use a <a> tag for webpage indirect, because:

  1. It doesn't require JavaScript
  2. It is easier to implement accessibility features
  3. It makes the HTML code more readable
<div class="navbar">
  <a>
    <div class="grid__item theme-1">
      <a href="https://www.w3docs.com/" class="button">Click Here</a>
      <button class="particles-button">Home</button>
    </div>
  </a>
</div>
XingZhi Lim
  • 131
  • 2
  • 6
-1
<button onclick="window.location.href='https://google.com'">Go to link</button>
Navneet Kumar
  • 623
  • 1
  • 6
  • 16