Web Development and Design Foundations with HTML5 (8th Edition)
8th Edition
ISBN: 9780134323534
Author: FELKE-MORRIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
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>”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
What exactly are the events that are available in JavaScript? Create a Script in order to show the onclick event.
Write a java script Program to display an ALERT box using ONCLICK event
Write some information about your Favourite TEACHER using <body> element.
What exactly are the events that JavaScript has? Create a Script to show the onclick event in action.
Chapter 14 Solutions
Web Development and Design Foundations with HTML5 (8th Edition)
Ch. 14.4 - Prob. 1CPCh. 14.4 - Prob. 2CPCh. 14.4 - Prob. 3CPCh. 14.6 - Prob. 1CPCh. 14.6 - Prob. 2CPCh. 14.6 - Prob. 3CPCh. 14.8 - Describe a method that can be used to gather a...Ch. 14.8 - Prob. 2CPCh. 14.8 - Prob. 3CPCh. 14.9 - Prob. 1CP
Ch. 14.9 - Prob. 2CPCh. 14.9 - Prob. 3CPCh. 14.18 - Prob. 1CPCh. 14.18 - Prob. 2CPCh. 14.18 - Prob. 3CPCh. 14 - Prob. 1MCCh. 14 - Prob. 2MCCh. 14 - Prob. 3MCCh. 14 - Prob. 4MCCh. 14 - Prob. 5MCCh. 14 - Prob. 6MCCh. 14 - Prob. 7MCCh. 14 - Prob. 8MCCh. 14 - Prob. 9MCCh. 14 - Prob. 10MCCh. 14 - Prob. 11MCCh. 14 - Prob. 12FIBCh. 14 - Prob. 13FIBCh. 14 - The ________ object is assumed to exist and it is...Ch. 14 - Prob. 15FIBCh. 14 - A form control button can be used with a(n)...Ch. 14 - Prob. 17FIBCh. 14 - Prob. 18FIBCh. 14 - Prob. 19SACh. 14 - Prob. 20SACh. 14 - Prob. 1AYKCh. 14 - Prob. 2AYKCh. 14 - Prob. 3AYKCh. 14 - Prob. 1HOECh. 14 - Prob. 2HOECh. 14 - Prob. 3HOECh. 14 - Prob. 4HOECh. 14 - Prob. 5HOECh. 14 - Prob. 6HOECh. 14 - Prob. 7HOECh. 14 - Prob. 8HOECh. 14 - Prob. 1WRCh. 14 - Prob. 2WRCh. 14 - Prob. 3WR
Knowledge Booster
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
- You have observed that some websites have password meter showing password strength, write a JavaScript or PHP code to check password at runtime when user enters it if password is less than 5 characters it show weak, if it is greater than 5 but less than 8 it shows medium and if greater than 8 then show strong. Additionally when user leave password field empty it shows error that“password must require”.arrow_forwardExplain the two different classes from the Android API that allow us to output messages. Give an example for each message by adding your name and student ID.arrow_forwardIn javaScript, how to verify that text and password boxes are not empty?arrow_forward
- using javascript, design an add button that when you click it, it displays 4 input text, one for id, another for type, a third for the price, and one for callory.arrow_forwardWhat possible outcomes might you anticipate while working with JavaScript? Use the onclick event by creating some code to display its functionality.arrow_forwardWhen using JavaScript, what kinds of events might you expect? Make use of the onclick event by writing a script to demonstrate it.arrow_forward
- . What will be the value of EAX and the Sign flag after the following lines execute?mov eax,5sub eax,6arrow_forwardWrite a javascript code to validate all fields of a registration form which has the following fields: Name, Phone Number(use regular expression pattern: "[0-9]{3}-[0-9]{3}-[0-9]{4}"), Email address (must not be empty and must be tested against the regular expression: /^\S+@\S+\.\S+$/ ) and Gender.arrow_forwardBy using NetBeans IDE,write the servlet program with html form to find out the average marks of the student. Take 5 subject marks and calculate the average with photos of output and program( screenshots).arrow_forward
- Using onchange along with conditional if..else or switch statements to print a different response based on a user’s selection from the dropdown list. Html and Javascript Onlyarrow_forward4) You are in charge of writing a JavaScript code to tell the user how well his/her password is as it is typed in. What is the best approach?A) Add onsubmit to submit button. Show message if password is weak and return false. B) Add onsubmit to submit button. Disable update button if password is too weak. C) Add onchange to password field. Update a message as password is changed. D) Add onfocusout to password field. Update a message as password is changed. 5) What event can we use to animate a picture once it is downloaded?A) onchange B) onload C) ondownloaded D) ongrantedarrow_forwardWindows tokens have two portions, which are Group of answer choices Accounts Identity Group membership Network connectionsarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning