HTML Datalist未填充

时间:2013-06-09 04:44:05

标签: html html5 html-datalist

这是示例html文档。为fave输入文本框添加了datalist标记。但它确实出现了。有什么想法吗?

<!DOCTYPE HTML>
<html>
    <head>
    <title>Example</title>

    <meta name="description" content="A simple example"/>

    </head>
    <body>
    <form method="post" action="WorkingWithFormsChapter.html" target="_blank">
        <label for="fave">Enther your favourite fruit</label>
        <input name="fave" autofocus="true" list="fruitslist"/>
        <br/>
        <label for="name">Enter your name</label>
        <input name="name" placeholder="Your name please" />
        <button>Submit Vote</button>
    </form>
    <datalist id="fruitslist">
        <option value="Tasty Apples">Apples</option>
        <option value="Juicy Oranges">Juicy Oranges</option>
    </datalist>
    </body>
</html>

1 个答案:

答案 0 :(得分:1)