
-----------------------------------
jayshaw94
Thu Aug 01, 2013 9:50 pm

Javascript program help
-----------------------------------
Hello guys. I'm in need of some help. I'm stressing out here. Teacher asked us to;

Write a program with the help of JavaScript which takes a number as input and displays all numbers from 1 to the number entered. For example, if the number entered is 5, the output should be:

1
2
3
4
5


I've been trying to use this somehow; but couldn't figure it out


  
    Click the button to calculate x.
    Try it
    
    Enter first number:
    Enter second number:
    
    
    
      function myFunction() {
        var y = document.getElementById("txt1").value;
        var z = document.getElementById("txt2").value;
        var x = y + z;
        document.getElementById("demo").innerHTML = x;
      }
    
  


-----------------------------------
jayshaw94
Fri Aug 02, 2013 2:41 pm

RE:Javascript program help
-----------------------------------
Sorry nevermind guys figured it out
