Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoCorrect files/zh-cn/web/api/htmlelement/ #5922

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/zh-cn/web/api/htmlelement/accesskey/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Element.accessKey
slug: Web/API/HTMLElement/accessKey
tags:
- API接口
- API 接口
- 属性
- 需要丰富内容
translation_of: Web/API/HTMLElement/accessKey
Expand All @@ -16,7 +16,7 @@
<p>元素的<strong> Element.accessKey</strong> 属性设置了这样一个按键——用户通过敲击这个键把焦点跳转到这个元素上。</p>

<div class="note">
<p>注: <em> <strong>Element.accessKey </strong>属性很少使用,因为它很容易与现代浏览器自带的快捷键冲突。为了解决这个问题,浏览器约定accessKey键与特定按键一起按(比如 Alt + accessKey)来生效快捷键行为。</em></p>
<p>注: <em> <strong>Element.accessKey </strong>属性很少使用,因为它很容易与现代浏览器自带的快捷键冲突。为了解决这个问题,浏览器约定 accessKey 键与特定按键一起按(比如 Alt + accessKey)来生效快捷键行为。</em></p>
</div>

<p> </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div>{{ APIRef("HTML DOM") }}</div>
</div>

<p><strong><code>HTMLElement.accessKeyLabel</code></strong> 只读属性返回一个 {{jsxref("String")}} 表示这个元素分配的访问密钥(如果有的话); 否则返回一个空字符串.</p>
<p><strong><code>HTMLElement.accessKeyLabel</code></strong> 只读属性返回一个 {{jsxref("String")}} 表示这个元素分配的访问密钥 (如果有的话); 否则返回一个空字符串</p>

<h2 id="Syntax" name="Syntax">语法</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

<div>{{SeeCompatTable}}</div>

<p>一个 <code><strong>animationcancel</strong></code> 事件会在一个 <a href="/en-US/docs/Web/CSS/CSS_Animations">CSS Animation</a> 意外终止时触发. 换句话说, 就是任意时刻 CSS Animation 在没有发送 {{event("animationend")}} 事件时停止运行. 这种情况会在  {{cssxref("animation-name")}} 发生改变导致动画被移除时, 或者使用CSS隐藏了动画中的node节点. 因此要么node节点直接被隐藏,要么因为node节点的父节点被隐藏.</p>
<p>一个 <code><strong>animationcancel</strong></code> 事件会在一个 <a href="/en-US/docs/Web/CSS/CSS_Animations">CSS Animation</a> 意外终止时触发换句话说就是任意时刻 CSS Animation 在没有发送 {{event("animationend")}} 事件时停止运行这种情况会在  {{cssxref("animation-name")}} 发生改变导致动画被移除时,或者使用 CSS 隐藏了动画中的 node 节点。因此要么 node 节点直接被隐藏,要么因为 node 节点的父节点被隐藏。</p>

<p>该事件的处理函数可以通过 {{domxref("GlobalEventHandlers.onanimationcancel", "onanimationcancel")}} 属性进行设置, 或者使用 {{domxref("EventTarget.addEventListener", "addEventListener()")}}.</p>
<p>该事件的处理函数可以通过 {{domxref("GlobalEventHandlers.onanimationcancel", "onanimationcancel")}} 属性进行设置或者使用 {{domxref("EventTarget.addEventListener", "addEventListener()")}}.</p>

<table class="properties">
<tbody>
Expand All @@ -34,7 +34,7 @@

<h2 id="Examples">Examples</h2>

<p>这段代码获取一个当前在动画中的元素,并为它添加了一个<code>animationcancel</code> 事件监听. 然后设置该元素的 <code><a href="/en-US/docs/Web/CSS/display">display</a></code> 属性为 <code>none</code>, 触发 <code>animationcancel</code> 事件.</p>
<p>这段代码获取一个当前在动画中的元素,并为它添加了一个<code>animationcancel</code> 事件监听然后设置该元素的 <code><a href="/en-US/docs/Web/CSS/display">display</a></code> 属性为 <code>none</code>, 触发 <code>animationcancel</code> 事件</p>

<pre class="brush: js">const animated = document.querySelector('.animated');

Expand All @@ -44,7 +44,7 @@ <h2 id="Examples">Examples</h2>

animated.style.display = 'none';</pre>

<p>同样, 使用 <code><a href="/en-US/docs/Web/API/GlobalEventHandlers/onanimationcancel">onanimationcancel</a></code> 属性替换 <code>addEventListener()</code>:</p>
<p>同样使用 <code><a href="/en-US/docs/Web/API/GlobalEventHandlers/onanimationcancel">onanimationcancel</a></code> 属性替换 <code>addEventListener()</code>:</p>

<pre class="brush: js">const animated = document.querySelector('.animated');
animated.onanimationcancel = () =&gt; {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
<div>{{APIRef}}</div>

<p><strong><code>animationiteration</code></strong> 事件将被触发 当<a href="/en-US/docs/Web/CSS/CSS_Animations">CSS 动画</a>的迭代结束且另一个迭代开始时。此事件不会与 {{domxref("HTMLElement/animationend_event", "animationend")}} 事件同时发生t, 因此对于<code>animation-iteration-count</code>次数为1的动画不会发生。</p>
<p><strong><code>animationiteration</code></strong> 事件将被触发 当<a href="/en-US/docs/Web/CSS/CSS_Animations">CSS 动画</a>的迭代结束且另一个迭代开始时。此事件不会与 {{domxref("HTMLElement/animationend_event", "animationend")}} 事件同时发生 t,因此对于<code>animation-iteration-count</code>次数为 1 的动画不会发生。</p>

<table class="properties">
<tbody>
Expand All @@ -34,7 +34,7 @@

<h2 id="例子">例子</h2>

<p>此代码使用 <code>animationiteration</code> 来跟踪动画已完成的迭代次数:</p>
<p>此代码使用 <code>animationiteration</code> 来跟踪动画已完成的迭代次数</p>

<pre class="brush: js notranslate">const animated = document.querySelector('.animated');

Expand All @@ -45,7 +45,7 @@ <h2 id="例子">例子</h2>
console.log(`Animation iteration count: ${iterationCount}`);
});</pre>

<p>相同, 但使用 <code>onanimationiteration</code> 事件处理程序属性:</p>
<p>相同但使用 <code>onanimationiteration</code> 事件处理程序属性:</p>

<pre class="brush: js notranslate">const animated = document.querySelector('.animated');

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/api/htmlelement/contextmenu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2 id="例子">例子</h2>

<pre class="brush: js">var contextMenu = document.getElementById("element").contextMenu;

// 修改条目1的标签
// 修改条目 1 的标签
contextMenu.firstElementChild.label = "New label";
</pre>

Expand Down
14 changes: 7 additions & 7 deletions files/zh-cn/web/api/htmlelement/copy_event/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p><strong>oncopy</strong>属性用来获取或设置当前元素的<code>copy</code>事件的事件处理函数.</p>
<p><strong>oncopy</strong>属性用来获取或设置当前元素的<code>copy</code>事件的事件处理函数</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<pre class="eval"><em>element</em>.oncopy = <em>functionRef</em>;
</pre>
<p><em>functionRef</em> 是一个函数名或者函数表达式.</p>
<p><em>functionRef</em> 是一个函数名或者函数表达式</p>
<h3 id="Example" name="Example">例子</h3>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;oncopy示例演示&lt;/title&gt;
&lt;title&gt;oncopy 示例演示&lt;/title&gt;

&lt;script&gt;
function log(txt)
Expand All @@ -25,18 +25,18 @@ <h3 id="Example" name="Example">例子</h3>
&lt;/head&gt;

&lt;body&gt;
&lt;div oncopy="log('复制被阻止!'); return false;"&gt;试着复制这句话!&lt;/div&gt;
&lt;div oncopy="log('复制被阻止'); return false;"&gt;试着复制这句话&lt;/div&gt;

&lt;h3&gt;Log&lt;/h3&gt;
&lt;textarea rows="15" cols="80" id="log" readonly="true"&gt;&lt;/textarea&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>上例演示了如何禁止复制浏览器中的一段话.</p>
<p>上例演示了如何禁止复制浏览器中的一段话</p>
<h3 id="Notes" name="Notes">备注</h3>
<p>当用户尝试复制选中元素或文本时会触发<code>copy</code>事件.</p>
<p>当用户尝试复制选中元素或文本时会触发<code>copy</code>事件</p>
<h3 id="Specification" name="Specification">规范</h3>
<p>不属于任何公开的规范.</p>
<p>不属于任何公开的规范</p>
<h3 id="See_also" name="See_also">相关链接</h3>
<ul>
<li><code><a href="/zh-cn/DOM/element.oncut" title="zh-cn/DOM/element.oncut">oncut</a></code></li>
Expand Down
18 changes: 9 additions & 9 deletions files/zh-cn/web/api/htmlelement/cut_event/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p><strong>oncut</strong>属性用来获取或设置当前元素的<code>cut</code>事件的事件处理函数.</p>
<p><strong>oncut</strong>属性用来获取或设置当前元素的<code>cut</code>事件的事件处理函数</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<pre class="eval"><em>element</em>.oncut = <em>functionRef</em>;
</pre>
<p><em>functionRef</em> 是一个函数名或者函数表达式.</p>
<p><em>functionRef</em> 是一个函数名或者函数表达式</p>
<h3 id="Example" name="Example">例子</h3>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;oncut示例演示&lt;/title&gt;
&lt;title&gt;oncut 示例演示&lt;/title&gt;

&lt;script&gt;
function log(txt)
Expand All @@ -25,20 +25,20 @@ <h3 id="Example" name="Example">例子</h3>
&lt;/head&gt;

&lt;body&gt;
&lt;h3&gt;按说明进行操作!&lt;/h3&gt;
&lt;textarea rows="3" cols="80" oncopy="log('复制成功!');" oncut="log('剪切被阻止!'); return false;"&gt;
尝试剪切和复制该文本域内的文本!
&lt;h3&gt;按说明进行操作&lt;/h3&gt;
&lt;textarea rows="3" cols="80" oncopy="log('复制成功');" oncut="log('剪切被阻止'); return false;"&gt;
尝试剪切和复制该文本域内的文本
&lt;/textarea&gt;
&lt;h3&gt;Log&lt;/h3&gt;
&lt;textarea rows="15" cols="80" id="log" readonly="true"&gt;&lt;/textarea&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>上例演示了如何允许复制一个文本域内的文本,但禁止剪切那些文本.并把每次操作结果打印出来.</p>
<p>上例演示了如何允许复制一个文本域内的文本但禁止剪切那些文本并把每次操作结果打印出来</p>
<h3 id="Notes" name="Notes">备注</h3>
<p>当用户尝试剪切选中元素或文本时会触发<code>cut</code>事件.</p>
<p>当用户尝试剪切选中元素或文本时会触发<code>cut</code>事件</p>
<h3 id="Specification" name="Specification">规范</h3>
<p>不属于任何公开的规范.</p>
<p>不属于任何公开的规范</p>
<h3 id="See_also" name="See_also">相关链接</h3>
<ul>
<li><code><a href="/zh-cn/DOM/element.oncopy" title="zh-cn/DOM/element.oncopy">oncopy</a></code></li>
Expand Down
14 changes: 7 additions & 7 deletions files/zh-cn/web/api/htmlelement/dir/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

<h3 id="Summary" name="Summary">概述</h3>

<p><code><strong>dir</strong></code>属性用于获取或设置当前元素的元素内容的文本书写方向.</p>
<p><code><strong>dir</strong></code>属性用于获取或设置当前元素的元素内容的文本书写方向</p>

<h3 id="Syntax_and_values" name="Syntax_and_values">语法</h3>

<pre class="eval">var <var>CurrentWritingDirection</var> = elementNodeReference.dir;
elementNodeReference.dir = <var>NewWritingDirection</var>;
</pre>

<p><code>CurrentWritingDirection</code>是一个字符串,表示当前元素的元素内容的文本书写方向. NewWritingDirection是一个变量,表示当前元素新的文本书写方向.</p>
<p><code>CurrentWritingDirection</code>是一个字符串表示当前元素的元素内容的文本书写方向. NewWritingDirection 是一个变量,表示当前元素新的文本书写方向</p>

<p><strong>dir</strong> 的值可以是<strong><code>ltr</code>, 表示从左到右</strong>, 和<strong><code>rtl</code>, 表示从右到左</strong>.</p>

<h3 id="Example" name="Example">例子</h3>

<pre>var parg = document.getElementById("para1");
parg.dir = "rtl";
// 改变一个元素的元素内容的文本书写方向.</pre>
// 改变一个元素的元素内容的文本书写方向</pre>

<h3 id="Notes" name="Notes">备注</h3>

<p>元素的文本书写方向是指文本的排列顺序(目的是为了支持其他不同语言的系统). 阿拉伯语和希伯来语是典型的使用 rtl 排列顺序的语言.</p>
<p>元素的文本书写方向是指文本的排列顺序 (目的是为了支持其他不同语言的系统). 阿拉伯语和希伯来语是典型的使用 rtl 排列顺序的语言</p>

<p>一个图像文件也可以将<code>dir</code>属性设置为"rtl",这样的话,它的<code>title和</code><code>alt</code>属性文字会按"rtl"顺序来显示.</p>
<p>一个图像文件也可以将<code>dir</code>属性设置为"rtl",这样的话它的<code>title 和</code><code>alt</code>属性文字会按"rtl"顺序来显示</p>

<p>当表格的<code>dir</code>属性设置为"rtl"时, 那么该表格的所有列将从右到左排列.</p>
<p>当表格的<code>dir</code>属性设置为"rtl"时那么该表格的所有列将从右到左排列</p>

<div class="geckoVersionNote">
<p>在Gecko 7.0 之前, 该属性的返回值不一定都是小写的.从 Gecko 7.0开始, 该属性的返回值全部为小写字母, 这也是规范中所规定的.</p>
<p>在 Gecko 7.0 之前该属性的返回值不一定都是小写的从 Gecko 7.0 开始,该属性的返回值全部为小写字母这也是规范中所规定的</p>
</div>

<h3 id="Specification" name="Specification">规范</h3>
Expand Down
28 changes: 14 additions & 14 deletions files/zh-cn/web/api/htmlelement/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
---
<div>{{APIRef}}</div>

<p>HTMLElement 接口表示所有的 <a href="/en-US/docs/Web/HTML" style="line-height: 1.5;" title="/en-US/docs/Web/HTML">HTML</a> 元素。一些HTML元素直接实现了HTMLElement接口,其它的间接实现HTMLElement接口.</p>
<p>HTMLElement 接口表示所有的 <a href="/en-US/docs/Web/HTML" style="line-height: 1.5;" title="/en-US/docs/Web/HTML">HTML</a> 元素。一些 HTML 元素直接实现了 HTMLElement 接口,其它的间接实现 HTMLElement 接口。</p>

<h2 id="属性">属性</h2>

Expand Down Expand Up @@ -112,27 +112,27 @@ <h2 id="属性">属性</h2>
<tr>
<td>{{domxref("HTMLElement.offsetHeight")}} {{readonlyInline}}</td>
<td><code>double</code></td>
<td>元素自身可视高度加上上下border的宽度</td>
<td>元素自身可视高度加上上下 border 的宽度</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.offsetLeft")}}{{readonlyInline}}</td>
<td><code>double</code></td>
<td>元素自己border左边距离父元素border左边或者body元素border左边的距离</td>
<td>元素自己 border 左边距离父元素 border 左边或者 body 元素 border 左边的距离</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.offsetParent")}}{{readonlyInline}}</td>
<td>{{domxref("Element")}}</td>
<td>元素的父元素,如果没有就是body元素</td>
<td>元素的父元素,如果没有就是 body 元素</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.offsetTop")}}{{readonlyInline}}</td>
<td><code>double</code></td>
<td>元素自己border顶部距离父元素顶部或者body元素border顶部的距离</td>
<td>元素自己 border 顶部距离父元素顶部或者 body 元素 border 顶部的距离</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.offsetWidth")}}{{readonlyInline}}</td>
<td><code>double</code></td>
<td>元素自身可视宽度加上左右border的宽度</td>
<td>元素自身可视宽度加上左右 border 的宽度</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.properties")}} {{readonlyInline}}{{experimental_inline}}</td>
Expand All @@ -147,17 +147,17 @@ <h2 id="属性">属性</h2>
<tr>
<td>{{domxref("HTMLElement.style")}}</td>
<td>{{domxref("CSSStyleDeclaration")}}</td>
<td>获取/设置元素的style属性</td>
<td>获取/设置元素的 style 属性</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.tabIndex")}}</td>
<td><code>long</code></td>
<td>获取/设置元素的tab键控制次序</td>
<td>获取/设置元素的 tab 键控制次序</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.title")}}</td>
<td>{{domxref("DOMString")}}</td>
<td>获取/设置元素的title属性</td>
<td>获取/设置元素的 title 属性</td>
</tr>
<tr>
<td>{{domxref("HTMLElement.translate")}} </td>
Expand Down Expand Up @@ -188,7 +188,7 @@ <h3 id="Event_handlers">Event handlers</h3>

<h2 id="方法">方法</h2>

<p><em>从父元素继承的方法, {{domxref("Element")}}.</em></p>
<p><em>从父元素继承的方法{{domxref("Element")}}.</em></p>

<table class="standard-table">
<thead>
Expand Down Expand Up @@ -246,7 +246,7 @@ <h2 id="规范">规范</h2>
<td>{{SpecName('HTML WHATWG', 'elements.html#htmlelement', 'HTMLElement')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>
<p>添加如下属性:</p>
<p>添加如下属性</p>

<p><code>translate,</code><code>itemScope,</code><code>itemType,</code><code>itemId,</code><code>itemRef,</code><code>itemProp,</code><code>properties,</code><code>itemValue。</code></p>

Expand All @@ -260,11 +260,11 @@ <h2 id="规范">规范</h2>
<td>{{SpecName('HTML5 W3C', 'dom.html#htmlelement', 'HTMLElement')}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>
<p>添加了如下属性:</p>
<p>添加了如下属性</p>

<p><code>dataset</code>, <code>hidden</code>, <code>tabindex</code>, <code>accessKey</code>, <code>accessKeyLabel</code>, <code>draggable</code>, <code>dropzone</code>, <code>contentEditable</code>, <code>isContentEditable</code>, <code>contextMenu</code>, <code>spellcheck</code>, <code>commandType</code>, <code>commandLabel</code>, <code>commandIcon</code>, <code>commandHidden</code>, <code>commandDisabled</code>, <code>commandChecked</code>, <code>style,和所有的 onXYZ属性</code></p>
<p><code>dataset</code>, <code>hidden</code>, <code>tabindex</code>, <code>accessKey</code>, <code>accessKeyLabel</code>, <code>draggable</code>, <code>dropzone</code>, <code>contentEditable</code>, <code>isContentEditable</code>, <code>contextMenu</code>, <code>spellcheck</code>, <code>commandType</code>, <code>commandLabel</code>, <code>commandIcon</code>, <code>commandHidden</code>, <code>commandDisabled</code>, <code>commandChecked</code>, <code>style,和所有的 onXYZ 属性</code></p>

<p><code>移动id和classname属性到</code>{{domxref("Element")}}接口上</p>
<p><code>移动 id 和 classname 属性到</code>{{domxref("Element")}}接口上</p>
</td>
</tr>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions files/zh-cn/web/api/htmlelement/innertext/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<p><code><strong>innerText</strong></code> 属性表示一个节点及其后代的“渲染”文本内容。 As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.</p>

<div class="blockIndicator note">
<p><strong>Note:</strong> <code>innerText</code> 很容易与{{domxref("Node.textContent")}}混淆, 但这两个属性间实际上有很重要的区别. 大体来说, <code>innerText</code> 可操作已被渲染的内容, 而 <code>textContent</code> 则不会.</p>
<p><strong>Note:</strong> <code>innerText</code> 很容易与{{domxref("Node.textContent")}}混淆但这两个属性间实际上有很重要的区别大体来说<code>innerText</code> 可操作已被渲染的内容, 而 <code>textContent</code> 则不会</p>
</div>

<h2 id="语法">语法</h2>
Expand All @@ -27,11 +27,11 @@ <h2 id="语法">语法</h2>

<h3 id="输出值">输出值</h3>

<p>一段 {{domxref("DOMString")}} 表示一个元素中已被渲染的内容. 如果元素自身没有 <a href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered">被渲染</a> (e.g 被从文档中删除或没有在视图中显示), 这时返回值与 {{domxref("Node.textContent")}} 属性相同.</p>
<p>一段 {{domxref("DOMString")}} 表示一个元素中已被渲染的内容如果元素自身没有 <a href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered">被渲染</a> (e.g 被从文档中删除或没有在视图中显示), 这时返回值与 {{domxref("Node.textContent")}} 属性相同</p>

<h2 id="示例">示例</h2>

<p>这个示例对比了 <code>innerText</code> 和 {{domxref("Node.textContent")}}. 这时 <code>innerText</code> 代表的含义就像 {{htmlElement("br")}} 标签, 并且忽略了隐藏的元素.</p>
<p>这个示例对比了 <code>innerText</code> 和 {{domxref("Node.textContent")}}. 这时 <code>innerText</code> 代表的含义就像 {{htmlElement("br")}} 标签并且忽略了隐藏的元素</p>

<h3 id="HTML">HTML</h3>

Expand Down
Loading