HTML Forms

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

Text field has more attributes like name, size, font, etc., check the TAG reference list on older posts.

About Jagadesh Boopathi

I am tech savy spending more time on technology, learning about web, making time to find new stuff always. Also I am Entrepreneur, Blogger and an Engineer. Open Source - Matters.

View all posts by Jagadesh Boopathi →

Leave a Reply

Your email address will not be published. Required fields are marked *