New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN: 9781305503922
Author: Patrick M. Carey
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
Chapter 11.1, Problem 2QC
Program Plan Intro
To provide the JavaScript code to run a function named setup () when the browser load the page. .
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Create a web page that contains three buttons and two images. To meet the requirements follow the instructions given below by writing JavaScript and jquery:
When user clicks the “Hide Images” button, both images should be vanished (jquery).
When user clicks the “Show Images” button, both images should be appeared again (jquery).
When user clicks the swap button, the height of both images should be swapped (JavaScript).
Create a web page that contains three buttons and two images. To meet the requirements
follow the instructions given below by writing JavaScript and jquery.
• When user clicks the "Hide Images" button, both images should be vanished (jquery).
• When user clicks the "Show Images" button, both images should be appeared again
(query).
When user clicks the swap button, the height of both images should be swapped
(JavaScript).
Hida images Show Images Swap Helght
Hide Images Show Images Swap Height
Instruction : Please add some css on the alert boxes. Change the color. Thank you! The HTML code with javascript is already provided. You just need to customize the alert prompt. Thanks!
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Applying Javascript in HTML</title>
<script>
function userPrompt() {
var lastName = prompt("Enter your Last name:");
var firstName = prompt("Enter your First name:");
alert("Hello " + lastName + ", " + firstName + "!");
const number1 = parseInt(prompt("Enter your 1st number:"));
const number2 = parseInt(prompt("Enter your 2nd number:"));
const sum = number1 + number2;
alert("The sum is: " + sum);
confirm(lastName + ", " + firstName + " you have added the numbers: " + number1 + " & " + number2 + " and got the sum: " + sum + ".");
}
</script>
</head>
<body onload='userPrompt()'>…
Chapter 11 Solutions
New Perspectives on HTML5, CSS3, and JavaScript
Ch. 11.1 - Prob. 1QCCh. 11.1 - Prob. 2QCCh. 11.3 - Provide the general code to create a function...Ch. 11.3 - Prob. 2QCCh. 11 - Prob. 1RACh. 11 - Prob. 2RACh. 11 - Prob. 3RACh. 11 - Prob. 4RACh. 11 - Prob. 5RACh. 11 - Prob. 6RA
Ch. 11 - Prob. 7RACh. 11 - Prob. 8RACh. 11 - Prob. 9RACh. 11 - Prob. 10RACh. 11 - Prob. 11RACh. 11 - Prob. 1CP1Ch. 11 - Prob. 2CP1Ch. 11 - Prob. 3CP1Ch. 11 - Prob. 4CP1Ch. 11 - Prob. 5CP1Ch. 11 - Prob. 6CP1Ch. 11 - Prob. 7CP1Ch. 11 - Prob. 8CP1Ch. 11 - Prob. 9CP1Ch. 11 - Prob. 2CP2Ch. 11 - Prob. 3CP2Ch. 11 - Prob. 5CP2Ch. 11 - Prob. 2CP3Ch. 11 - Prob. 3CP3Ch. 11 - Prob. 1CP4Ch. 11 - Prob. 2CP4Ch. 11 - Prob. 3CP4Ch. 11 - Prob. 4CP4Ch. 11 - Prob. 5CP4Ch. 11 - Prob. 6CP4Ch. 11 - Prob. 7CP4
Knowledge Booster
Similar questions
- Create a web page that contains three buttons and two images. To meet the requirements follow the instructions given below by writing JavaScript and jquery: • When user clicks the "Hide Images" button, both images should be vanished (jquery). • When user clicks the "Show Images" button, both images should be appeared again (jquery). • When user clicks the swap button, the height of both images should be swapped (JavaScript). Hide Images Show Images Swap Height| Hide Images Show Images Swap Heightarrow_forwardObjective:To add scripting to the existing web page and work with JavaScript Es-6 features like class, object , getter methods and collection. Problem Description:As part of a simple billing application, you are provided with an html page to obtain inputs for item number, item name, price & quantity. Using the ES-6 collections, add every item object into a Set and iterate through it to find the total cost to be paid. On adding each item object into Set, it must also get added to the table as a new record. Refer to the screenshot. Following are the files that contain code snippets index.html HTML for webpage (complete implementation is given for you). You only have to run this. No change needs to be done in this file. script.js Add your code to this file for the functions given. Procedure to complete the exercise Class Properties Methods Item itemNumberitemNamepricequantity Include constructor with properties and getter methods for Item properties…arrow_forwardin javascript Create a function that will load a new image from the website https://cataas.com/cat every 10 seconds, and will stop this interval when the SPACEBAR is pressed.arrow_forward
- In Javascript, Create a mouseOver event function, that will change the colour of an HTML item (i.e. a button or a list item) to green, then to black after 5 secondsarrow_forwardCreate JavaScript code to display the nodeName and nodeType for all nodes in the current HTML document using childNodes. Use a JavaScript object (key/value pairs) to look up the nodeType and convert the type number to a string description. Create JavaScript code to display the current window size, screen size, and location information. Use the resize event to update the display whenever the window size changes.arrow_forwardWrite the HTML code to output the followings. Do this task as at it given in the image with same format , style ,bold style. everything remain same as given in the image.arrow_forward
- Write a complete HTML code with jQuery to hide all paragraph when the user clicks on a button. Consider the following picture as a reference.arrow_forwardPlease help me with the following exercise. Use your programming environment to generate a simple Web site using Python flask. The site should be unique, include at least 3 routes (e.g. 3 pages one can navigate), each route should render the HTML pages by using the render_template() functionality. A style sheet should be included that is used by all Web pages. Proper organization should take place of the web site including the location of templates and static pages. Keep in the basic HTML form for a function web page includes the following components: <!DOCTYPE html><html><head><title>Page Title</title></head><body>...your page content...</body></html> In addition to the requirements list above the following functionality should be found within your web site on one or more web pages.• Use at least 3 different heading styles (e.g. <h1>, <h2>, <h3>)• Paragraph (<p>)• Comments <!-- -->)• Ordered list•…arrow_forwardUse AJAX requests and design the page with a heading and two buttons where onclicking the first button should display the list of all <empid, email> as an unorderedlist. The second button should display all the <empid, contact in the form of a table.arrow_forward
- Javascript allowsWrite a page using a balloon emoji (?). When you push the up arrow, it should increase 10%, and when you press the down arrow, it should decrease 10%.Emoji are text, hence adjusting its parent element's font-size CSS property (style.fontSize) controls its size. Remember to provide a unit, such as pixels (10px)."Arrow Up" and "Arrow Down" are the arrow keys. Make sure the keys modify the balloon without scrolling.arrow_forwardCreate a simple Login page with User ID and Password fields () and a login button. Create a JavaScript function that will check if user id and password are empty. The function will not allow the form to be submitted to the server if any field is empty.arrow_forwardImagine that the HTML file for your web page project includes a div element with the id value “cupcake” and you are writing a function to display and rearrange some images within that element. What JavaScript statement would you place in the blank to move the last image within the ccFrostingelement to the beginning of the line and shift the other images one position toward the end? let frostingFiles = ["pinkFr.jpg", "blueFr.jpg", "chocFr.jpg"] let frostingCount = frostingFiles.length; function frostCupcake() { let cupCake = document.getElementById("cupcake"); let ccFrosting = document.createElement("div"); cupCake.appendChild(ccFrosting); ccFrosting.id = "ccFrosting"; for (let i = 0; i < frostingCount; i++) { let image = document.createElement("img"); image.src = frostingFiles[i]; ccFrosting.appendChild(image); } function shuffleBack() { _____ } } a. ccFrosting.appendChild(ccFrosting.firstElementChild); b.…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning