列出 HTML5 中用于输入值的不同选项
HTML <datalist> 标签为 <input> 元素指定一组选项。你可以尝试运行以下代码,以在 HTML5 中列出输入值的选项 −
示例
<!DOCTYPE html> <html> <head> <title>HTML Datalist Tag</title> </head> <body> <input list = "tutorials" /> <datalist id = "tutorials"> <option value = "Java"> <option value = "ASP"> <option value = "PHP"> <option value = "Ruby"> <option value = "jQuery"> </datalist> <p>Try to add any of the tutorial name mentioned above.</p> </body> </html>
广告