Another of the many new input types that HTML5 supports is URL
. How many times have you built a form using <input type="text" />
intending to collect a website address? Now we can use something much more semantically correct! Later we'll see how this supports form validation as well.
The previous FoundationSix example could be easily converted to this new input type as well. Instead of:
<li> <label for="website">Website</label> <input id="website" name="website" type="text" class="required"> </li>
We could simply change the input type and end up with:
<li>
<label for="website">Website</label>
<input id="website" name="website" type="URL" class="required">
</li>
Like <input type="email" />
visually, the <input type="URL" />
tag looks identical to <input type="text" />
. Again, the difference is what the browser does with the information entered.