Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Form
Form

Form is used to collect data from users using input fields.

Syntax

<form>
inputs fields here...
</form>


You can use form any where within an HTML document.


Example

First Name: Last Name:

Note:

Use <br /> element to separate inputs on new line.


Form is pair tag and output of form is inputs fields like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Create a form
  • add two input fields into form
  • one input field should be type=text
  • second input field should be type=password
  • Now add submit button of type=submit
  • Use <br /> to separate input fields on new line

save file with name task.html or task.htm and then open it using any browser and see results.


Solution




Don't forget form is non empty element which means it always comes in pair.