“HTML 表单元素”的版本间差异
本页内容
(→元素) |
(→元素) |
||
第22行: | 第22行: | ||
<label for="fname">名字:</label> | <label for="fname">名字:</label> | ||
<input type="text" id="fname" name="fname"> | <input type="text" id="fname" name="fname"> | ||
<input type="submit" value="提交"> | |||
</form> | </form> | ||
</sample> | </sample> |
2022年8月14日 (日) 21:28的版本
HTML <form> 元素可以包含以下一个或多个表单元素:
- <input>
- <label>
- <select>
- <textarea>
- <button>
- <fieldset>
- <legend>
- <datalist>
- <output>
- <option>
- <optgroup>
<input> 元素
最常用的表单元素之一是 <input> 元素。
元素可以通过 <input> 多种方式显示,具体取决于 type 属性。
示例
<form action="/third/http.php" method="GET">
<label for="fname">名字:</label>
<input type="text" id="fname" name="fname">
<input type="submit" value="提交">
</form>