Parcourir la source

DOM: база

Vladislav342 il y a 2 ans
Parent
commit
6692b04105
1 fichiers modifiés avec 7 ajouts et 6 suppressions
  1. 7 6
      HW_06/index.html

+ 7 - 6
HW_06/index.html

@@ -64,7 +64,8 @@
 	<input type="number" id="num1" placeholder="number 1">
    	<input type="number" id="num2" placeholder="number 2">
    	<button id="plus">Sum</button>
-   	<input type="number" id='result'>
+   	<input type="number" id='result' oninput="calc()">
+
 
 	<script>
 
@@ -219,15 +220,15 @@
 			result.value=(+num1.value)+(+num2.value);
 		}
 
-		// ??????????
-
-		//input1.oninput = calc;
-		//input2.oninput = calc;
+		num1.oninput = calc;
+		num2.oninput = calc;
 		
 
-
+		//button уже не нужен
 
 
 	</script>
+	
+	
 </body>
 </html>