title: What is the different return false and event.preventDefault in javascript?
body: <p>I searched for a similar question and someone claimed that <code>return false</code> is similar to <code>event.stopPropagation()</code> and <code>event.preventDefault()</code>, but I have tried the claimed examples and it doesn't work. The code is below:</p>
  <pre><code>&lt;ul&gt;
      &lt;li&gt;
          &lt;a href=&quot;&quot;&gt;baidu.com&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>This is the code of html.</p>
  <pre><code>ul.addEventListener('click', function(event) {
      alert('ul');
  }, false);
  
  li.addEventListener('click', function() {
      alert('li');
  }, false);
  
  a.addEventListener('click', function(event) {
      alert('a');
      return false;
  }, false);
  </code></pre>
  <p>This is the code of js.</p>
  <p>If the return false is both <code>event.stopPropagation()</code> and <code>event.preventDefault()</code>.</p>
  <p>It will only <code>alert('a')</code>, but finally it alerts three times.</p>