013:二人の相性は抜群!

chshcky : 2018/01/14(日) - 00:37

1."Section-012.html"をコピーして編集

  • "Section-012.html"をコピーして"Section-013.html"を作成(?→008,012)
  • After
<script>
    function showAnswer() {
        var leftValues = [];
        leftValues[1] = Number(document.getElementById("left1").value);
        leftValues[2] = Number(document.getElementById("left2").value);
        var rightValues = [];
        rightValues[1] = Number(document.getElementById("right1").value);
        rightValues[2] = Number(document.getElementById("right2").value);

        var loopCount = 1;
        var sum = 0;
        while (loopCount <= 2) {
            sum = leftValues[loopCount] + rightValues[loopCount];
            alert(leftValues[loopCount] + "+" + rightValues[loopCount] + "=" + sum);
            loopCount = loopCount + 1;
        }
    }
</script>

<input id="left1" type="text" value="1"> + <input id="right1" type="text" value="2"><br>
<input id="left2" type="text" value="3"> + <input id="right2" type="text" value="4"><br>
<input type="button" value="?" onclick="showAnswer();">

Section-012.html → Section-013.html RENAMED
7
7
rightValues[1] = Number(document.getElementById("right1").value);
8
8
rightValues[2] = Number(document.getElementById("right2").value);
9
9
 
10
 
- var sum = leftValues[1] + rightValues[1];
11
 
- alert(leftValues[1] + "+" + rightValues[1] + "=" + sum);
12
 
-
13
 
- sum = leftValues[2] + rightValues[2];
14
 
- alert(leftValues[2] + "+" + rightValues[2] + "=" + sum);
 
10
+ var loopCount = 1;
 
11
+ var sum = 0;
 
12
+ while (loopCount <= 2) {
 
13
+ sum = leftValues[loopCount] + rightValues[loopCount];
 
14
+ alert(leftValues[loopCount] + "+" + rightValues[loopCount] + "=" + sum);
 
15
+ loopCount = loopCount + 1;
 
16
+ }
15
17
}
16
18
</script>
17
19
 
  • 保存する[Ctrl+S]

section-013_edit.gif

2.Edgeで開いて答を見る

  • "Section-013.html"を"Microsoft Edge"で開く(?→004)
  • "?"をクリック

section-013_open.gif

     

Comments

Syphilis And Amoxicillin Clavulanate Zithromax Elixir Buying Progesterone No Prescription Cytotec Et Cialis Prix Cialis Pharmacie Paris Comment Faire Du Viagra

Comment