HTML 表单元素
本页内容
HTML <form> 元素可以包含以下一个或多个表单元素:
- <input>
- <label>
- <select>
- <textarea>
- <button>
- <fieldset>
- <legend>
- <datalist>
- <output>
- <option>
- <optgroup>
<input> 元素
最常用的表单元素之一是 <input> 元素。
元素可以通过 <input> 多种方式显示,具体取决于 type 属性。
示例
<label for="fname">名字:</label>
<input type="text" id="fname" name="fname">