aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/statements/if...else/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/statements/if...else/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/statements/if...else/index.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/statements/if...else/index.html b/files/zh-cn/web/javascript/reference/statements/if...else/index.html
index 3c64ce0538..3d5ebf6e8f 100644
--- a/files/zh-cn/web/javascript/reference/statements/if...else/index.html
+++ b/files/zh-cn/web/javascript/reference/statements/if...else/index.html
@@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Statements/if...else
<p>{{EmbedInteractiveExample("pages/js/statement-ifelse.html")}}</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox">if (<em>condition</em>)
<em>statement1</em>
@@ -37,7 +37,7 @@ translation_of: Web/JavaScript/Reference/Statements/if...else
<dd>如果<code>condition</code>为假且 <code>else</code>从句存在时执行的语句。可为任意语句,包括块语句和嵌套的<code>if</code>语句。</dd>
</dl>
-<h2 id="Description" name="Description">说明</h2>
+<h2 id="Description">说明</h2>
<p>多层 <code>if...else</code> 语句可使用 <code>else if</code> 从句。注意:在 Javascript 中没有 <code>elseif</code> (一个单词)关键字。</p>
@@ -80,9 +80,9 @@ else
if (b) //表达式的值为true
</pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example:_Using_if...else" name="Example:_Using_if...else">使用 <code>if...else</code></h3>
+<h3 id="Example:_Using_if...else">使用 <code>if...else</code></h3>
<pre class="brush: js">if (cipher_char === from_char) {
result = result + to_char;
@@ -104,7 +104,7 @@ if (b) //表达式的值为true
/* do the right thing */
}</pre>
-<h3 id="Example:_Assignment_within_the_conditional_expression" name="Example:_Assignment_within_the_conditional_expression">条件表达式中的赋值运算</h3>
+<h3 id="Example:_Assignment_within_the_conditional_expression">条件表达式中的赋值运算</h3>
<p>建议不要在条件表达式中单纯的使用赋值运算,因为粗看下赋值运算的代码很容易让人误认为是等性比较。比如,不要使用下面示例的代码:</p>
@@ -161,7 +161,7 @@ if (b) //表达式的值为true
<p>{{Compat("javascript.statements.if_else")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("Statements/block", "block")}}</li>