Write a Javascript that have two functions: 1. getData: Prompt the user to enter 4 numbers and store them in an array. (
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a Javascript that have two functions: 1. getData: Prompt the user to enter 4 numbers and store them in an array. (
Write a Javascript that have two functions: 1. getData: Prompt the user to enter 4 numbers and store them in an array. (Use window.prompt) 2. calcProd: This function will take the array as an argument and will calculate the product of the numbers given in the array. If the array is empty the product should be one. The result should be printed in a paragraph in the HTML file. Exercise 2 Download the files in "Website" folder, to work on index.html file. Include your own javascript code or file to the index.html and do the following once the page loads: • Change the font color of all paragraphs in the web page. • Change all of the Images alt attribute text to ‘This is an alt text for the image' . Change all the background color of the images. Replace the content of the div whose id is 'newDiv' to an underordered list that contains the names of all departments in the King Hussien School of Computing Sciences. Add a form button at the end of the page with text "Click Here". When the user clicks on the button, a changeText function should be called, and this function should change the logo on the top of the page to psut.png. . Add another form button "Remove last div", that when the user clicks it, will remove the whole div "newDiv" (This is a bonus question).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!