> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/javascript/click-lan-dau-su-event.preventdefault-lau-sau-not-event.preventdefault.md).

# Click lần đầu sử event.preventDefault(); lầu sau not event.preventDefault();

![](https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYjAG13rAPdbArSfRyB%2F-Lx4RUFxeI2feuy3dHh4%2F-Lx4RrLaHTGTLYnpZaD1%2FClick%20One%2C%20Click%20More.png?alt=media\&token=63cf71db-bab7-4f05-8e1b-44b978469a33)

```
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>

<body>
  <ul>
  <li><a href="home/">Home</a></li>
  <li><a href="news/">News</a></li>
  <li class="subnav"><a href="about/">About</a>
    <ul>
      <li><a href="contact/">contact</a></li>
    </ul>
  </li>
</ul>
<script>
  function stopEventOnce(event) {
    event.preventDefault();
    $(this).unbind('click', stopEventOnce);
    return false;
  }
  $(".subnav a").bind('click', stopEventOnce);
</script>
</body>

</html>
```
