Welcome to the Treehouse Community
Looking to learn something new?
What CSS is needed to make a text box automatically active when the sign in page opens?
I noticed that when I Googled "Treehouse Sign in" and clicked on the Sign in page, the text box for "Name" was automatically "active" and the cursor was blinking as if I'd clicked on the box myself. But if I have been doing a lesson and sign out, then go to sign in again later from the drop down arrow on that same page, when the Sign In box pops up, the "Name" text box is NOT active and the cursor isn't blinking inside of it -- until I click on the Name text box myself. Does anyone know what code is needed to automatically activate a text box when a page is opened or a text box pops up on a page?
Rebecca Bompiani16,945 Points
This is known as "autofocus" and is generally an attribute of the HTML input
Name: <input type="text" name="tName" autofocus>