Forms are used everywhere on the web. One of the simplest forms you will find is a search form. In this exercise, you will create a form to search on Google. Follow the steps below to create your form.
- Edit the
index.html
file. Find the line that says<p>Delete this line and add your form.</p>
. Delete it. - Add a
<form>
to the same line where you deleted the text. The<form>
should have two attributes: amethod
attribute that isGET
and anaction
attribute that ishttps://www.google.com/search
. - Inside of the
<form>
create an<input>
field. Thetype
attribute should betext
and thename
attribute should beq
.
If you've done this correctly, you should be able to type into the field and hit ENTER
and it will show you Google search results!