Simple addition Quiz for kids

We will now present some real world programs that you can see and extend to do something that will further enhance your understanding. In this example kids are presented with simple addition problems. You need to enter the result of the addition and it will tell if the result is correct or incorrect.

<!DOCTYPE html>
<script type="text/javascript" src="jquery-1.8.0.min.js">
var rand1 = Math.round(Math.random()*8+1);

var rand2 = Math.round(Math.random()*8+1);

    var x = $("input#id4").val();
    var y = Number($("input#id2").val()) + Number($("input#id3").val());
   if ( y == Number($("input#id4").val())) {var msg ="Correct";
   $("span#id5").html(msg );}

   else {var msg ="InCorrect";
$("span#id5").html(msg );


<input id ="id2" type="text" value ="Generate"  style="border: none" readonly>
<br />
+<input id ="id3" type="text" value ="Generate"  style="border: none" readonly>
<br />
<input  id="id4" type="text">
<br />
<span id ="id5">Enter Result</span> <br />


You may like to try this example here.