Here we will learn about how to create text box for getting any input from the user like username or password.
Following code for creating text box(username):
<input type=”text” name=”username” />
for password box just change the type as Password
<input type=”password” name=”pass” />
Output will be like this for above code:
Username:
Password:
In order to get values from the text box or field we need forms to get the data from the field using their names.
<form action=”” method=””>
<input type=”text” name=”username” />
<input type=”password” name=”pass” />
<input type=”button” value=”Submit”/>
</form>
Output of above code will be