Question: 1. Write a function with no parameters, which uses a prompt box to receive a number from the user and if that number is greater

1. Write a function with no parameters, which uses a prompt box to receive a number from the user and if that number is greater than or equal to 100, it should alert 'large number' and otherwise it should alert 'small number'.

2. Write the code for a function with no parameter, which reads the text from a textbox with the id of "txt1" and alerts it.

3. Write the code for a function with no parameters, which creates a random number between 0 and 1 using Math.random() and if the number is greater than 0.5, it should alert 'heads', and if not, it should alert 'tails'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!