title: How can I achieve click event in JavaScript?
body: <p>I select a span element on the page. For the first click, I want it to link to another page. On the second click, I want it to return to the original page.</p>
  <p>For example, I have a link with <code>example.com</code>, which is the original. When this element &quot;abcd&quot; is clicked I want it to link to <code>example.com/ar</code>, and when it's clicked again I want it to go back to <code>example.com</code>.</p>
  <pre><code>document.querySelector('span.arb').addEventListener('click', function() {
    a.href=&quot;example.com&quot;;
  })
  </code></pre>
  <p>How do I complete this using the above?</p>