HTML and CSS Reference
In-Depth Information
5 <title>Document</title>
6 </head>
7 <body>
8 <section>
9
<form action="">
10
Email <input type=””>
11
</form>
12 </section>
13 </body>
14 </html>
Since you definitely want people to give an email, make the field a requirement, using “re-
quired”. If someone tries to complete a form without entering a valid email address, they
will receive an message asking them to enter one. This field will can also be given a name,
in case you decide to use a back-end later. This is where the “name” attribute, and the
“email” value, are used. Your code should now look like this:
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>Document</title>
6 </head>
7 <body>
8 <section>
9
<form action="">
10
Email <input type=” email name=”email” required >
11
</form>
12 </section>
Search WWH ::




Custom Search