I'm using Bootstrap on a site. Bootstrap is loading via a cdn. I can't edit the code directly. How can I remove the form auto focus? When I visit the page it automatically jumps down to the bottom of the page where the form is.

  • Can you add a dummy input at the top of the page? – Stephen Ostermiller Jun 13 '18 at 19:24
  • That did not work. – Matt McLennan Jun 13 '18 at 19:33
  • Better just to use JavaScript with something like: document.querySelector('classname-of-element').autofocus = false; – Simon Hayter Jun 14 '18 at 10:23
  • Bootstrap does not cause auto-focus by itself on a form so you have either set the autofocus attribute on the field, or some other JS is setting it. – Zhaph - Ben Duguid Jun 15 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.