HTML5: Search box

This entry is part 19 of 34 in the series HTML5

HTML5 provides a search box feature. ┬áTo define a search box, use type=’search’.

You could also add a results field such as results=’5′.

This keeps the previous 5 search terms. Now with these history search terms, it could notify users if a term has been used before.

<!DOCTYPE html>
<html lang='en'>
    <meta charset='utf-8'>
    <title> Search Box</title>
<form role='search'>
    <label for='search'>Search term</label>
    <input required type='search' results='5' id='search' name='search'/>
    <input type='submit' value='Go'/>

Series Navigation<< HTML5: Form validation
HTML5: Calendar and time >>