The last property: autofocus
We are just about done but I wanted to talk about one more global attribute autofocus. This attribute will enable you to default set a focus to one of your input fields.
Video Transcript
00:00Alright, so this is the last thing we're going to learn in this one before last cluster of topics and the topic was forms obviously
00:07So what is the last thing we're going to learn about is basically in our form right now as soon as we load the form in
00:13Nothing is selected by default
00:15But if you ever been on a form many times there's something that's selected by default
00:19For example, it would be really useful if our user would be automatically selected
00:23So as soon as a user comes on to the page
00:25It would automatically select that element ready to get the users to start typing
00:29To make that happen is really really easy. The way we do that is we add the property auto focus
00:35Now the property out of focus if we just find our user on input user
00:38We could just type space and right after they just type auto focus
00:44By doing that we're basically telling the browser
00:46This is the first element that we want to be in focus when our application loads
00:50So this time around when I click on refresh
00:52We'll see that automatically as soon as I refresh the page will go directly to that user
00:57Enabling us to start off from there and many users, you know
00:59They just type the tab and never even grab the keyboard. So by you doing that you're saving a
01:06Step that the user needs to do it a lot of times in sales that one step is more than than you need
01:11So, you know, it's that many times
01:14If we have a submission
01:16It's only an email that you want to submit and the user needs to type to press on to that email thing and then type
01:22Their email you'll have a small portion of users that will never do it just because they had to type
01:26But if you said that they're their input in default
01:30It's almost like you're propping them to start typing inside which hires the probability of them giving you their email
01:36They don't have to use the mouse because they don't have to use the mouse. It's like those small little tricks
01:40Yeah, okay. So that's it about the new things that we're gonna learn
01:44It's a lot more smaller details that you're gonna learn but you'll do that as you start working with forms more deeply
01:49Which I encourage you to do that. Obviously if the topic interests you I'm sure that the more you work on it
01:54The more you're going to learn it, especially if you take our JavaScript course
02:00Thanks for watching this course, um, it's been a blast the course is not over
02:04But this segment of the course on working with HTML forms is done
02:09It's been over an hour. You've learned a lot
02:11It's time for you to go and practice and take a break and obviously give us a great score if you've enjoyed the course
02:17tweet share love
02:20support send us gifts
02:22Whatever you want to do address it to me the gifts not him. Yes, but send really like
02:29Geeky stuff because my mom loves geeky stuff
02:34Anyway, so thanks for watching and we'll see you in the next course or the next segment
02:38If you're in our mega course and the mega course the next segment is going to be all about the table
02:44Which is going to be our last big topic in HTML
