Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
9th Edition
ISBN: 9780134801148
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
A6 Develop a calculator using JavaFX, similar to the following: The user can enter integer numbers for Number 1 and Number 2. When each of the Add/Sub/Mul/Div buttons is clicked, the result is displayed in the Result box. Test your code for each case and take screenshots. Submit the screenshots with your Java code.
Question 20 Write JavaFX statement to display the upper half of a circle with radius 50 centered at (100, 100). Response Feedback: (None Given)
Assignment 0 D3:13 Write a JavaScript code that reads five numbers between 1 and 30. -If the data is not a number, or less than 1 or more than 30,output XHTML text that displays an alert dialog and allow the user to enter a new value after dismissing the alert dialog. -For each number read output XHTML text that displays a line containing the same number of adjacent asterisks. -Draw the asterisks inside table (it is a red asterisks). -For example, if your program reads numbers5, 4, 9, 3, 10 the output should be as follow: ** n
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT