145k views
2 votes
Problem 2-1 Random Number Problem

Build an application where each time a button is clicked, a random number from 1 to 100 is displayed in a textField

User Perceval
by
7.4k points

1 Answer

5 votes

Answer:

how do i make a button generate a random number and each time the button is clicked a new number is generated and added to the previous number. I need help making a button generate a random number in java script, i would like when the button is pressed for it to generate a random number between 1-10 and and then once the button is pressed again for it to generate a new random number but the sum of both number to show each time the button is presses.

Step-by-step explanation:

User Taemyr
by
7.1k points