Web Development and Design Foundations with HTML5 (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
8th Edition
ISBN: 9780134322759
Author: Terry Felke-Morris
Publisher: PEARSON
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 14.8, Problem 2CP

Explanation of Solution

Program:

<!--HTML Tag-->

<html>

<!--Body Tag-->

<body>

<!--Script Tag-->

<script>

//Declaration of variable

var userAge;

//Prompt the input from user

userAge=prompt("Enter user's Age");

/*Condition to check age*/

if (userAge < 18)

{

/*If true, display the "You are under 18" message*/

alert("You are under 18");

}

//Otherwise

else

{

/*If false, display the "You are 18 or older" message*/

alert("You are 18 or older");

}

//Close the script tag

</script>

<!--Close Tag-->

</body>

<!--Close Tag-->

</html>

Explanation:

  • The HTML tag was included using “<html>”...

Blurred answer
Students have asked these similar questions
Write JavaScript codes to validate a name text field so that when a user submits the form with the name field empty or with numeric value an alert message should be displayed to the user. The form submission should be accepted when the user enters a non-numeric value with a success alert message.
Rules:  1. Kindly code it in a proper way  2. The symbols and values are posted here:  r1 = outer radiusr2 = inner radiusC1 = outer circumferenceC2 = inner circumferenceA1 = area of circle of r1, area within outer circleA2 = area of circle of r2, area within inner circleA0 = shaded area, outer area minus inner areaA0 = A1 - A2π = pi = 3.1415926535898√ = square root   3. Example of the code is this Annalus Calculator  https://www.calculatorsoup.com/calculators/geometry-plane/annulus.php 4.. Please don't reject      CODE THE FOLLOWING (SEE ATTACHED PHOTO):
Q1. Write a JavaFX program to display the text College of Applied Sciences as shown in the following figure. Show Text College of Applied Sclences Q2. Write a JavaFX program to design a window as shown in the following figure. Hello World! Add Subtract Multiply Divide First Number: Second Nu Result Add the code to do the required event handling for the buttons in the panel.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,