Question

Using HTML to write a static page. The user needs to give input (number N) at...

Using HTML to write a static page. The user needs to give input (number N) at first and after that, there will be N buttons shown below. Number N is less than 10. Would someone please help that? Thank you!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program :

<html>

<head><title> N number of Buttons </title>

</head>
<body>
<script>

var i,N;
N=parseInt(prompt("Enter a number (N < 10)"));

if(N<10 && N>0)
{
for(i=1;i<=N;i++)
{
document.write("<input type=button value='Button : "+i+"'>"+" ");
}
}
else
{
alert("Please enter a number N which should be less than 10! ");
}
</script>

</body>
</html>


Output:

Add a comment
Know the answer?
Add Answer to:
Using HTML to write a static page. The user needs to give input (number N) at...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a calculator program using JavaScript in HTML in the same HTML file. (There will only...

    Write a calculator program using JavaScript in HTML in the same HTML file. (There will only be 1 HTML file containing everything that you use for this program.) *************JavaScript Functions should be written in the HTML <head> .............. </head> tag, **************** (Please be mindful of the formatting of the text of your program. Meaning that do not copy paste everything in a single line. Add clear comments for a better understanding of your program) as follows Assignment: create a form...

  • Create a HTML with Java Script such that you input a number between 222 and 333....

    Create a HTML with Java Script such that you input a number between 222 and 333. Then the user needs to guess the number. If the user’s guess is higher than the number, the program should display “Too high, try again.” If the user’s guess is lower than the number, the program should display “Too low, try again.” If the difference is less than 10, it should also mention "too close". When the user guesses the number, the program should...

  • Write a java program that will print if n numbers that the user will input are...

    Write a java program that will print if n numbers that the user will input are or not within a range of numbers. For that, your program needs to ask first for an integer number called N that will represent the number of times that will ask for other integer numbers. Right after, it should ask for two numbers that will represent the Min and Max for a range. Lastly. it will iterate N number times asking for an integer...

  • Write a function fun(x) that takes as input a positive number x and solves the following...

    Write a function fun(x) that takes as input a positive number x and solves the following equation for y and returns y. The equation is 10^4y=x+3. Can someone help me this question by using python? I shouldn't get input from user and cannot use loop/if statement as well. Please and thank you.

  • use C++ to write the following program. needs to ask the user for n The user...

    use C++ to write the following program. needs to ask the user for n The user must put in those 5 values, probably using a for loop. NOTE: You can assume the number of values to be entered is 5. My attempted program below: (not correct, but just a basis) 4. Larger Than n In a program, write a function that accepts three arguments: an array, the size of the array, and a number n. Assume that the array contains...

  • Create your page(s) using “’s Kung Fu Panda Po Sequence” as the page title(s) (tag). Save...

    Create your page(s) using “’s Kung Fu Panda Po Sequence” as the page title(s) (tag). Save the first page as index.htm (or index.php). Use a HTML form to capture user input. Submit the form to a second file index_process.php using the POST method. (3 points) The second page contains a link to go back to the first page. Allow the user to click on one of the four buttons. You must use for loop, while loop or do..while loop for...

  • Write a html javascript program to do the following: the user inputs a number, for example,...

    Write a html javascript program to do the following: the user inputs a number, for example, 50 user presses a button, labeled START the program creates 50 random buttons around the browser window each button should be placed at a random location each button should be labeled with a random number between 1 and 50 add the following features every 2 seconds, move each button around by increment or decrementing its location if the user clicks on a button, change...

  • Write a javascript that asks the user to input a number. The number is then passed into a functio...

    Im lost I need help seriously Write a javascript that asks the user to input a number. The number is then passed into a function you write that contains a loop. The loop will loop the number you passed into the function and print out the word "CSU" that many times. For instance, if l entered 3, the function would print out "CSU CSU CSU". (20 points) 5. Write a javascript that asks the user to input a number. The...

  • Computer Guesses - Create a page that allows the user to think of a number from...

    Computer Guesses - Create a page that allows the user to think of a number from 1 to 100. Write a function that will guess the number the user chose. The user will provide clues: higher or lower and correct. It should take no more than 7 guesses to get the correct number. User Guesses - Create a page that generates a random number from 1 to 100. Allow the user only 7 guesses to guess the number. Provide clues:...

  • Modify the following file, so that: If the user input for the age input box is...

    Modify the following file, so that: If the user input for the age input box is empty, please send the user a warning message: “Age field cannot be empty” and return to the form web page to allow the user to re-input the age; If the user input for the age input box is incorrect (e. g. less than 1), please also send the user a warning message: “Your age input is not correct!” and return to the form web...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT