HTML Input Types
Input Type Text
<input type="text"> defines a one-line text input field:
Example
<form>
First name:<br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
User name:<br>
<input type="text" name="username"><br>
User password:<br>
<input type="password" name="psw">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form action="/action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey"><br>
Last name:<br>
<input type="text" name="lastname" value="Mouse"><br><br>
<input type="submit" value="Submit">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form action="/action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey"><br>
Last name:<br>
<input type="text" name="lastname" value="Mouse"><br><br>
<input type="submit" value="Submit">
<input type="reset">
</form>
First name:<br>
<input type="text" name="firstname" value="Mickey"><br>
Last name:<br>
<input type="text" name="lastname" value="Mouse"><br><br>
<input type="submit" value="Submit">
<input type="reset">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
</form>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
<input type="checkbox" name="vehicle1" value="Bike"> I have a bike<br>
<input type="checkbox" name="vehicle2" value="Car"> I have a car
</form>
<input type="checkbox" name="vehicle1" value="Bike"> I have a bike<br>
<input type="checkbox" name="vehicle2" value="Car"> I have a car
</form>
This is the manner by which the HTML code above will be displayed in a browser:
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
Select your favorite color:
<input type="color" name="favcolor">
</form>
Select your favorite color:
<input type="color" name="favcolor">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31"><br>
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02"><br>
</form>
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31"><br>
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02"><br>
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
Birthday (date and time):
<input type="datetime-local" name="bdaytime">
</form>
Birthday (date and time):
<input type="datetime-local" name="bdaytime">
</form>
This is the manner by which the HTML code above will be displayed in a browser:
Example
<form>
E-mail:
<input type="email" name="email">
</form>
E-mail:
<input type="email" name="email">
</form>
0 comments:
Post a Comment