Browse Source

<HW7>upd done

Mark 1 year ago
parent
commit
186829ca90
1 changed files with 3 additions and 5 deletions
  1. 3 5
      07/main.js

+ 3 - 5
07/main.js

@@ -8,9 +8,7 @@
 //          this.style.backgroundColor = 'red'
 //       }
 //       td.onmouseout = function () {
-//          this.style.backgroundColor = 'white'
-//          if (i % 2 !== 0) { this.style.backgroundColor = '#e9e9e9' }
-//          else { this.style.backgroundColor = 'white'; }
+//          i % 2 !== 0 ? this.style.backgroundColor = '#e9e9e9' : this.style.backgroundColor = 'white'
 //       }
 //       if (i % 2 !== 0) { td.style.backgroundColor = '#e9e9e9' }
 //       td.innerText = j * i
@@ -69,8 +67,8 @@ let calc = document.getElementById("calc");
 let input1 = document.getElementById("input1");
 let input2 = document.getElementById("input2");
 let result = document.getElementById("result");
-function calc1() {
-   result.innerText = (+input1.value) * (+input2.value)
+let calc1 = function () {
+   return result.innerText = (+input1.value) * (+input2.value);
 }
 input1.oninput = calc1
 input2.oninput = calc1