HTML <form> and <input> tags
adding user interactivity on a webpage
Forms give the otherwise static web page a layer of interactivity ...
... instead of just the website giving the user data, the user can also give the website data!
Structure
A simple form in HTML may look like this:
Elements
Breaking that into small pieces, let's begin with the parent <form>
tag:
action
refers to where the form will take us once we submit the formmethod
refers to how the form will submit (and what the URL will look like upon the form's submission)POST
- submitting data - the URL would have no query strings (the URL would have "?" followed by some text)GET
- retrieving data - the URL would have query strings (e.g.index.html?fname=Jon
)
Last updated