With the help of our HTML, CSS, JS online PRACTICE IT editor, you will be able to see the web result of our various HTML, CSS, JS examples and edit same to see the results even as you learn.
This was developed to hasten the learning process. That is, you learn something and see the result immediately even as you learn when you click on the "PRACTICE IT" button on any of the examples.
<h1>ADD TWO NUMBERS</h1>
<input id='num1' type='number'></div>
<input id='num2' type='number'></div>
var num1 = document.getElementById("num1").value;
var num2 = document.getElementById("num2").value;
num1 = (num1 != ""? num1: 0);
num2 = (num2 !=""? num2: 0);
sum = parseInt(num1) + parseInt(num2);
document.getElementById("sum").innerHTML = "The sum of "+num1+" and "+num2+" is "+sum;
Copy PRACTICE IT
Click on the "PRACTICE IT
" button above to see the result of the example.
On the "result" page, you can click on SOURCE CODE
to see the code that produced the result and also edit same to produce different results.