Learn HTML | Lesson 7 | Input From User
Learn HTML
Part 7
Hi, welcome to part 7 of our course, today we will be learning how to take input from the user. Taking input from the user is really useful and is used in countless websites. To take input write the following in your HTML file:
<Input type="text" placeholder="Enter Your Name"></input> | What this does is create a field where the user can type a input. The type="text" attribute defines that we have to take input in text from the user, and placeholder="" defines what to write inside the field.
How to create a checkbox | To create a checkbox do the following:
<input type="checkbox"></input> | In this code it would create a checkbox which you can tick or untick. The Label Tag | The label tag is really important, placeholders can't be used in checkboxes, so you can type this before the input:
<label>Tick If You Are From London</label> | What it does is it just creates a text in which you can write whatever to label your checkbox and it would appear.
Input Password | If you want to take passwords from users, you must tell the browser you are taking a password as if the browser gets to know its a password it would automatically add some normal password controls to it. To add a password input type this:
<label>Type Your Password:</label><input type="password"></input> | It is really easy, if you run the code now there would be some adjustments made by the browser to make the password safe.
Comments
Post a Comment