diff --git a/site/content/docs/5.3/getting-started/javascript.md b/site/content/docs/5.3/getting-started/javascript.md index 8efb2fb00ac8..80c222fcd04e 100644 --- a/site/content/docs/5.3/getting-started/javascript.md +++ b/site/content/docs/5.3/getting-started/javascript.md @@ -118,9 +118,7 @@ All infinitive events provide [`preventDefault()`](https://developer.mozilla.org const myModal = document.querySelector('#myModal') myModal.addEventListener('show.bs.modal', event => { - if (!data) { - return event.preventDefault() // stops modal from being shown - } + return event.preventDefault() // stops modal from being shown }) ```