Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>First task HS</title>
</head>
<body>
<form name="myForm" id="eForm" onsubmit = "calculate(fNum,sNum)">
    <label for="first">First number</label>
        <input type="text" id="first" name="firstInteger"><br>
    <label for="second">Second number</label>
        <input type="text" id="second" name="secondInteger"><br>
        <input type="submit" value="Submit">
</form>
<div id="result">
</div>
<script>
    var fNum = document.getElementById("first").value;
    var sNum = document.getElementById("second").value;
    var list = []
    var i;
        function calculate(fNum,sNum) {
            for( var i = fNum; i <= sNum; i++){
                list.push(i);
                
            }
            console.log(list);
    }
    
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
OMISpro
0viewers