diff options
Diffstat (limited to 'files/zh-cn/web/html/element/input/index.html')
| -rw-r--r-- | files/zh-cn/web/html/element/input/index.html | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/files/zh-cn/web/html/element/input/index.html b/files/zh-cn/web/html/element/input/index.html index 7a0eec9474..5bebc87291 100644 --- a/files/zh-cn/web/html/element/input/index.html +++ b/files/zh-cn/web/html/element/input/index.html @@ -82,7 +82,7 @@ translation_of: Web/HTML/Element/input <tbody> <tr> <td>{{HTMLElement("input/button", "button")}}</td> - <td>没有默认行为的按钮,上面显示 {{anch('value')}} 属性的值,默认为空。</td> + <td>没有默认行为的按钮,上面显示 <a href="#attr-value">value</a> 属性的值,默认为空。</td> <td id="examplebutton"> <pre class="brush: html hidden"> <input type="button" name="button" /></pre> @@ -136,7 +136,7 @@ translation_of: Web/HTML/Element/input </tr> <tr> <td>{{HTMLElement("input/file", "file")}}</td> - <td>让用户选择文件的控件。使用{{anch('accept')}}属性规定控件能选择的文件类型。</td> + <td>让用户选择文件的控件。使用 <a href="#attr-accept">accept</a> 属性规定控件能选择的文件类型。</td> <td id="examplefile"> <pre class="brush: html hidden"> <input type="file" accept="image/*, text/*" name="file"/></pre> @@ -151,7 +151,7 @@ translation_of: Web/HTML/Element/input </tr> <tr> <td>{{HTMLElement("input/image", "image")}}</td> - <td>带图像的 <code>submit</code> 按钮。显示的图像由 <code>src</code> 属性规定。如果 {{anch('src')}} 缺失,{{anch('alt')}} 属性就会显示。</td> + <td>带图像的 <code>submit</code> 按钮。显示的图像由 <code>src</code> 属性规定。如果 <a href="#attr-src">src</a> 缺失,<a href="#attr-alt">alt</a> 属性就会显示。</td> <td id="exampleimage"> <pre class="brush: html hidden"> <input type="image" name="image" src="" alt="image input"/></pre> @@ -187,7 +187,7 @@ translation_of: Web/HTML/Element/input </tr> <tr> <td>{{HTMLElement("input/radio", "radio")}}</td> - <td>单选按钮,允许在多个拥有相同 {{anch('name')}} 值的选项中选中其中一个。</td> + <td>单选按钮,允许在多个拥有相同 <a href="#attr-name">name</a> 值的选项中选中其中一个。</td> <td id="exampleradio"> <pre class="brush: html hidden"> <input type="radio" name="radio"/></pre> @@ -196,7 +196,7 @@ translation_of: Web/HTML/Element/input </tr> <tr> <td>{{HTMLElement("input/range", "range")}}</td> - <td>此控件用于输入不需要精确的数字。控件是一个范围组件,默认值为正中间的值。同时使用{{anch('htmlattrdefmin')}} 和 {{anch('htmlattrdefmax')}}来规定值的范围。</td> + <td>此控件用于输入不需要精确的数字。控件是一个范围组件,默认值为正中间的值。同时使用 <a href="#attr-min">min</a> 和 <a href="#attr-max">max</a> 来规定值的范围。</td> <td id="examplerange"> <pre class="brush: html hidden"> <input type="range" name="range" min="0" max="25"/></pre> @@ -312,124 +312,124 @@ translation_of: Web/HTML/Element/input </thead> <tbody> <tr> - <td>{{anch('htmlattrdefaccept', 'accept')}}</td> + <td><a href="#attr-accept">accept</a></td> <td>file</td> <td>用于规定文件上传控件中期望的文件类型</td> </tr> <tr> - <td>{{anch('htmlattrdefalt', 'alt')}}</td> + <td><a href="#attr-alt">alt</a></td> <td>image</td> <td>image type 的 alt 属性,是可访问性的要求。</td> </tr> <tr> - <td>{{anch('htmlattrdefautocomplete', 'autocomplete')}}</td> + <td><a href="#attr-autocomplete">autocomplete</a></td> <td>所有</td> <td>用于表单的自动填充功能</td> </tr> <tr> - <td>{{anch('htmlattrdefautofocus', 'autofocus')}}</td> + <td><a href="#attr-autofocus">autofocus</a></td> <td>所有</td> <td>页面加载时自动聚焦到此表单控件</td> </tr> <tr> - <td>{{anch('htmlattrdefcapture', 'capture')}}</td> + <td><a href="#attr-capture">capture</a></td> <td>file</td> <td>文件上传控件中媒体拍摄的方式</td> </tr> <tr> - <td>{{anch('htmlattrdefchecked', 'checked')}}</td> + <td><a href="#attr-checked">checked</a></td> <td>radio, checkbox</td> <td>用于控制控件是否被选中</td> </tr> <tr> - <td>{{anch('htmlattrdefdirname', 'dirname')}}</td> + <td><a href="#attr-dirname">dirname</a></td> <td>text, search</td> <td>表单区域的一个名字,用于在提交表单时发送元素的方向性</td> </tr> <tr> - <td>{{anch('htmlattrdefdisabled', 'disabled')}}</td> + <td><a href="#attr-disabled">disabled</a></td> <td>所有</td> <td>表单控件是否被禁用</td> </tr> <tr> - <td>{{anch('htmlattrdefform', 'form')}}</td> + <td><a href="#attr-form">form</a></td> <td>所有</td> <td>将控件和一个 form 元素联系在一起</td> </tr> <tr> - <td>{{anch('htmlattrdefformaction', 'formaction')}}</td> + <td><a href="#attr-formaction">formaction</a></td> <td>image, submit</td> <td>用于提交表单的 URL</td> </tr> <tr> - <td>{{anch('htmlattrdefformenctype', 'formenctype')}}</td> + <td><a href="#attr-formenctype">formenctype</a></td> <td>image, submit</td> <td>表单数据集的编码方式,用于表单提交</td> </tr> <tr> - <td>{{anch('htmlattrdefformmethod', 'formmethod')}}</td> + <td><a href="#attr-formmethod">formmethod</a></td> <td>image, submit</td> <td>用于表单提交的 HTTP 方法 </td> </tr> <tr> - <td>{{anch('htmlattrdefformnovalidate', 'formnovalidate')}}</td> + <td><a href="#attr-formnovalidate">formnovalidate</a></td> <td>image, submit</td> <td>提交表单时绕过对表单控件的验证</td> </tr> <tr> - <td>{{anch('htmlattrdefformtarget', 'formtarget')}}</td> + <td><a href="#attr-formtarget">formtarget</a></td> <td>image, submit</td> <td>表单提交的浏览上下文</td> </tr> <tr> - <td>{{anch('htmlattrdefheight', 'height')}}</td> + <td><a href="#attr-height">height</a></td> <td>image</td> <td> <p>和 {{htmlelement('img')}} 的 <code>height</code> 属性相同;垂直方向</p> </td> </tr> <tr> - <td>{{anch('htmlattrdeflist', 'list')}}</td> + <td><a href="#attr-list">list</a></td> <td>绝大部分</td> <td>自动填充选项的{{htmlelement('datalist')}} 的 id 值</td> </tr> <tr> - <td>{{anch('htmlattrdefmax', 'max')}}</td> + <td><a href="#attr-max">max</a></td> <td>数字 type</td> <td>最大值</td> </tr> <tr> - <td>{{anch('htmlattrdefmaxlength', 'maxlength')}}</td> + <td><a href="#attr-maxlength">maxlength</a></td> <td>password, search, tel, text, url</td> <td><code>value</code> 的最大长度(最多字符数目)</td> </tr> <tr> - <td>{{anch('htmlattrdefmin', 'min')}}</td> + <td><a href="#attr-min">min</a></td> <td>数字 type</td> <td>最小值</td> </tr> <tr> - <td>{{anch('htmlattrdefminlength', 'minlength')}}</td> + <td><a href="#attr-minlength">minlength</a></td> <td>password, search, tel, text, url</td> <td><code>value</code> 的最小长度(最少字符数目)</td> </tr> <tr> - <td>{{anch('htmlattrdefmultiple', 'multiple')}}</td> + <td><a href="#attr-multiple">multiple</a></td> <td>email, file</td> <td>布尔值。 是否允许多个值</td> </tr> <tr> - <td>{{anch('htmlattrdefname', 'name')}}</td> + <td><a href="#attr-name">name</a></td> <td>所有</td> <td>input 表单控件的名字。以名字/值对的形式随表单一起提交</td> </tr> <tr> - <td>{{anch('htmlattrdefpattern', 'pattern')}}</td> + <td><a href="#attr-pattern">pattern</a></td> <td>password, text, tel</td> - <td>匹配有效 <code>value</code> 的模式(pattern)</td> + <td>匹配有效 <code>value</code> 的模式(pattern)</td> </tr> <tr> - <td>{{anch('htmlattrdefplaceholder', 'placeholder')}}</td> + <td><a href="#attr-placeholder">placeholder</a></td> <td>password, search, tel, text, url</td> <td>当表单控件为空时,控件中显示的内容</td> </tr> @@ -444,32 +444,32 @@ translation_of: Web/HTML/Element/input <td>布尔值。表示此值为必填项或者提交表单前必须先检查该值</td> </tr> <tr> - <td>{{anch('htmlattrdefsize', 'size')}}</td> + <td><a href="#attr-size">size</a></td> <td>email, password, tel, text</td> <td>控件的大小</td> </tr> <tr> - <td>{{anch('htmlattrdefsrc', 'src')}}</td> + <td><a href="#attr-src">src</a></td> <td>image</td> <td>和{{htmlelement('img')}} 的 <code>src</code> 属性一样;图像资源的地址</td> </tr> <tr> - <td>{{anch('htmlattrdefstep', 'step')}}</td> + <td><a href="#attr-step">step</a></td> <td>数字 type</td> <td>有效的递增值</td> </tr> <tr> - <td>{{anch('htmlattrdeftype', 'type')}}</td> + <td><a href="#attr-type">type</a></td> <td>所有</td> <td>input 表单控件的 type</td> </tr> <tr> - <td>{{anch('htmlattrdefvalue', 'value')}}</td> + <td><a href="#attr-value">value</a></td> <td>所有</td> <td>表单控件的值。以名字/值对的形式随表单一起提交</td> </tr> <tr> - <td>{{anch('htmlattrdefwidth', 'width')}}</td> + <td><a href="#attr-width">width</a></td> <td>image</td> <td>与 {{htmlelement('img')}} 的 <code>width</code> 属性一样</td> </tr> @@ -566,7 +566,7 @@ translation_of: Web/HTML/Element/input </dd> <dt id="htmlattrdefdirname">{{htmlattrdef("dirname")}}</dt> <dd> - <p>Valid for <code>text</code> and <code>search</code> input types only, the <code>dirname</code> attribute enables the submission of the directionality of the element. When included, the form control will submit with two name/value pairs: the first being the {{anch('name')}} and {{anch('value')}}, the second being the value of the <code>dirname</code> as the name with the value of <code>ltr</code> or <code>rtl</code> being set by the browser.</p> + <p>Valid for <code>text</code> and <code>search</code> input types only, the <code>dirname</code> attribute enables the submission of the directionality of the element. When included, the form control will submit with two name/value pairs: the first being the <a href="#attr-name">name</a> and <a href="#attr-value">value</a>, the second being the value of the <code>dirname</code> as the name with the value of <code>ltr</code> or <code>rtl</code> being set by the browser.</p> <pre><code><form action="page.html" method="post"> <label>Fruit: <input type="text" name="fruit" dirname="fruit.dir" value="cherry"></label> @@ -617,7 +617,7 @@ translation_of: Web/HTML/Element/input <dd>如果<strong>type</strong>属性的值是<span style="font-family: courier new;">image,这个属性定义了按钮图片的高度。</span></dd> <dt id="htmlattrdefheight">{{htmlattrdef("id")}}</dt> <dd> - <p>Global attribute valid for all elements, including all the input types, it defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking. The value is used as the value of the {{htmlelement('label')}}'s <code>for</code> attribute to link the label with the form control. See the {{anch('the label element')}} below.</p> + <p>Global attribute valid for all elements, including all the input types, it defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking. The value is used as the value of the {{htmlelement('label')}}'s <code>for</code> attribute to link the label with the form control. See the <a href="#labels">the label element</a> below.</p> </dd> <dt id="htmlattrdefheight">{{htmlattrdef("inputmode")}}</dt> <dd> @@ -687,7 +687,7 @@ translation_of: Web/HTML/Element/input <dd> <p>Valid for <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, and <code>password</code>, it defines the minimum number of characters (as UTF-16 code units) the user can enter into the entry field. This must be an non-negative integer value smaller than or equal to the value specified by <code>maxlength</code>. If no <code>minlength</code> is specified, or an invalid value is specified, the input has no minimum length.</p> - <p>The input will fail <a href="/zh-CN/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a> if the length of the text entered into the field is fewer than <code>minlength</code> UTF-16 code units long, preventing form submission. See {{anch("Client-side validation")}} for more information.</p> + <p>The input will fail <a href="/zh-CN/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a> if the length of the text entered into the field is fewer than <code>minlength</code> UTF-16 code units long, preventing form submission. See <a href="#client-side_validation">Client-side validation</a> for more information.</p> </dd> <dt>{{ htmlattrdef("multiple") }}{{ HTMLVersionInline(5) }}</dt> <dd>This Boolean attribute indicates whether the user can enter more than one value.这个属性指示用户能否输入多个值。这个属性仅在<strong>type</strong>属性为 email 或 file 的时候生效 ; 否则被忽视。</dd> @@ -719,10 +719,10 @@ translation_of: Web/HTML/Element/input <dd>元素在当前文档的 Tab 导航顺序中的位置。</dd> <dt id="htmlattrdefformenctype">{{htmlattrdef('title')}}</dt> <dd> - <p>Global attribute valid for all elements, including all input types, containing a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. The title should NOT be used as the primary explanation of the purpose of the form control. Instead, use the {{htmlelement('label')}} element with a <code>for</code> attribute set to the form control's {{htmlattrdef('id')}} attribute. See {{anch("Labels")}} below.</p> + <p>Global attribute valid for all elements, including all input types, containing a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. The title should NOT be used as the primary explanation of the purpose of the form control. Instead, use the {{htmlelement('label')}} element with a <code>for</code> attribute set to the form control's {{htmlattrdef('id')}} attribute. See <a href="#labels">Labels</a> below.</p> </dd> <dt>{{ htmlattrdef("type") }}</dt> - <dd>要呈现的控件类型。有关各个类型的信息,请参阅 {{anch("Form <input> types")}},其中包含指向每个类型的更多信息的链接。</dd> + <dd>要呈现的控件类型。有关各个类型的信息,请参阅 <a href="#<input>_types">Form <input> types</a>,其中包含指向每个类型的更多信息的链接。</dd> <dt>{{ htmlattrdef("usemap") }} {{ HTMLVersionInline(4) }} only, {{ obsoleteGeneric("inline", "HTML5") }}</dt> <dd>作为图像映射的{{ HTMLElement("map") }}元素的名称。</dd> <dt>{{ htmlattrdef("value") }}</dt> |
