[HTML5] test input type="list"

master
Juan Massuelles 2 years ago
parent e1c00ce6dc
commit 658d2b9a18

@ -4,22 +4,31 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" /> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title> <title>Input type="list"</title>
<style>
input[list]:invalid ~ datalist {
display:block!important;
}
</style>
</head> </head>
<body> <body>
<p> <ul>
initial sample : <a href=""></a> <li>ref : <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist</a></li>
</p> </ul>
<form action="/action_page.php" method="get"> <form action="" method="get">
<input list="browsers" name="browser"> <input type="text" list="browsers" name="browser" pattern="(IE|Firefox|Chrome|Opera|Safari)">
<datalist id="browsers"> <datalist id="browsers">
<option value="Internet Explorer"> <span class="info">Merci de choisir parmis :</span>
<option value="Firefox"> <option value="IE">Internet Explorer</option>
<option value="Chrome"> <option value="FF">Firefox</option>
<option value="Cr">Chrome</option>
<option value="Opera"> <option value="Opera">
<option value="Safari"> <option value="Safari">
</datalist> </datalist>
<input type="submit"> <input type="submit">
</form> </form>
<p class="note">
Note: The <option> element can store a value as internal content and in the value and label attributes. Which one will be visible in the drop-down menu depends on the browser, but when clicked, content entered into control field will always come from the value attribute.
</p>
</body> </body>
</html> </html>

Loading…
Cancel
Save