diff options
Diffstat (limited to 'files/zh-cn/web/html/element/input/month/index.html')
-rw-r--r-- | files/zh-cn/web/html/element/input/month/index.html | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/files/zh-cn/web/html/element/input/month/index.html b/files/zh-cn/web/html/element/input/month/index.html index 58ceb8f2ea..b56e44f05e 100644 --- a/files/zh-cn/web/html/element/input/month/index.html +++ b/files/zh-cn/web/html/element/input/month/index.html @@ -14,8 +14,6 @@ original_slug: Web/HTML/Element/Input/月份 <div>{{EmbedInteractiveExample("pages/tabbed/input-month.html", "tabbed-shorter")}}</div> - - <p>这个控件在各个浏览器支持都不同,目前是支持部分浏览器。在桌面上支持情况为 Chrome/Opera 和 Edge 。在移动端支持大部分现代浏览器。在其他浏览器中,这个控件会被优雅的降级到<code><a href="/en-US/docs/Web/HTML/Element/input/text"><input type="text"></a></code>.</p> <p>对于那些使用不支持的浏览器的用户,Chrome / Opera 月份控制如下图所示。单击右侧的向下箭头会显示日期选择器,以便您选择日期;你必须手动输入时间。</p> @@ -29,7 +27,7 @@ original_slug: Web/HTML/Element/Input/月份 <table class="properties"> <tbody> <tr> - <td><strong>{{anch("Value")}}</strong></td> + <td><strong><a href="#value">Value</a></strong></td> <td>一个 {{domxref("DOMString")}} 代表一个月,一年,或者是空。</td> </tr> <tr> @@ -88,19 +86,19 @@ monthControl.value = '1978-06';</pre> </thead> <tbody> <tr> - <td><code>{{anch("max")}}</code></td> + <td><code><a href="#attr-max">max</a></code></td> <td>The latest year and month to accept as a valid input</td> </tr> <tr> - <td><code>{{anch("min")}}</code></td> + <td><code><a href="#attr-min">min</a></code></td> <td>The earliest year and month to accept as a valid input</td> </tr> <tr> - <td><code>{{anch("readonly")}}</code></td> + <td><code><a href="#attr-readonly">readonly</a></code></td> <td>A Boolean which, if present, indicates that the input's value can't be edited</td> </tr> <tr> - <td><code>{{anch("step")}}</code></td> + <td><code><a href="#attr-step">step</a></code></td> <td>A stepping interval to use when incrementing and decrementing the value of the input field</td> </tr> </tbody> @@ -108,7 +106,7 @@ monthControl.value = '1978-06';</pre> <h3 id="htmlattrdef(max)">{{htmlattrdef("max")}}</h3> -<p>The latest year and month, in the string format discussed in the {{anch("Value")}} section above, to accept. If the {{htmlattrxref("value", "input")}} entered into the element exceeds this, the element fails <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a>. If the value of the <code>max</code> attribute isn't a valid string in "<code>yyyy-MM</code>" format, then the element has no maximum value.</p> +<p>The latest year and month, in the string format discussed in the <a href="#value">Value</a> section above, to accept. If the {{htmlattrxref("value", "input")}} entered into the element exceeds this, the element fails <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a>. If the value of the <code>max</code> attribute isn't a valid string in "<code>yyyy-MM</code>" format, then the element has no maximum value.</p> <p>This value must specify a year-month pairing later than or equal to the one specified by the <code>min</code> attribute.</p> @@ -140,7 +138,7 @@ monthControl.value = '1978-06';</pre> <p>我们在往下看更多关于<code><input type="month"></code>基础和更多的高级的用法</p> -<p>, 下面将讲有关缓解浏览器支持问题的建议 (请参阅{{anch("Handling browser support")}}).</p> +<p>, 下面将讲有关缓解浏览器支持问题的建议 (请参阅<a href="#handling_browser_support">Handling browser support</a>).</p> <h3 id="Basic_uses_of_month">Basic uses of month</h3> @@ -169,7 +167,7 @@ monthControl.value = '1978-06';</pre> <ul> <li>月份只有在 2017 年八月份到 1900 年一月可以选择 — 在这个控件里这个范围以外的月份不能滚动选择。</li> - <li>Depending on what browser you are using, you might find that times outside the specified values might not be selectable in the time picker (e.g. Edge), or invalid (see {{anch("Validation")}}) but still available (e.g. Chrome).</li> + <li>Depending on what browser you are using, you might find that times outside the specified values might not be selectable in the time picker (e.g. Edge), or invalid (see <a href="#validation">Validation</a>) but still available (e.g. Chrome).</li> </ul> <div class="note"> @@ -184,7 +182,7 @@ monthControl.value = '1978-06';</pre> <p>By default, <code><input type="month"></code> does not apply any validation to entered values. The UI implementations generally don't let you enter anything that isn't a date — which is helpful — but you can still not fill in a date and submit, or enter an invalid date (e.g. the 32th of April).</p> -<p>You can use {{htmlattrxref("min", "input")}} and {{htmlattrxref("max", "input")}} to restrict the available dates (see anch("Setting maximum and minimum dates")), and in addition use the {{htmlattrxref("required", "input")}} attribute to make filling in the date mandatory. As a result, supporting browsers will display an error if you try to submit a date that is outside the set bounds, or an empty date field.</p> +<p>You can use {{htmlattrxref("min", "input")}} and {{htmlattrxref("max", "input")}} to restrict the available dates (see <a href="#设置最长和最短日期">Setting maximum and minimum dates</a>, and in addition use the {{htmlattrxref("required", "input")}} attribute to make filling in the date mandatory. As a result, supporting browsers will display an error if you try to submit a date that is outside the set bounds, or an empty date field.</p> <p>Let's look at an example — here we've set minimum and maximum dates, and also made the field required:</p> |