diff options
| author | XhmikosR <[email protected]> | 2017-09-28 17:25:28 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-28 17:25:28 +0300 |
| commit | 502ac7ee4d13669e644b9181f1e014ce0ea1f089 (patch) | |
| tree | bccf9e2d6b1eed69e5bed78fbfba410b23478b1a /docs/4.0/components | |
| parent | fe06814f3e3c72f36bb2ab96df206cc564fb74b0 (diff) | |
| download | bootstrap-502ac7ee4d13669e644b9181f1e014ce0ea1f089.tar.xz bootstrap-502ac7ee4d13669e644b9181f1e014ce0ea1f089.zip | |
Lint docs js too and use `strict consistently. (#24160)
Diffstat (limited to 'docs/4.0/components')
| -rw-r--r-- | docs/4.0/components/forms.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index 76d14dde9..ed4d95b70 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied <script> // Example starter JavaScript for disabling form submissions if there are invalid fields (function() { - "use strict"; - window.addEventListener("load", function() { - var form = document.getElementById("needs-validation"); - form.addEventListener("submit", function(event) { - if (form.checkValidity() == false) { + 'use strict'; + + window.addEventListener('load', function() { + var form = document.getElementById('needs-validation'); + form.addEventListener('submit', function(event) { + if (form.checkValidity() === false) { event.preventDefault(); event.stopPropagation(); } - form.classList.add("was-validated"); + form.classList.add('was-validated'); }, false); }, false); -}()); +})(); </script> {% endexample %} |
