Web Development and Design Foundations with HTML5 (8th Edition)
8th Edition
ISBN: 9780134322759
Author: Terry Felke-Morris
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 14, Problem 1AYK
Explanation of Solution
The given HTML code shows a message “hello” in “alert()” pop up menu, when user clicks on the “click me” button.
Given code:
<!--HTML Tag-->
<!DOCTYPE html>
<html lang="en">
<!--Head Tag-->
<head>
<!--Title Tag and close the tag-->
<title>JavaScript Practice</title>
<!--Meta Tag-->
<meta charset="utf-8">
<!--Script Tag-->
<script>
//Function definition
function mystery()
{
//Alert() method
alert('hello');
}
<!--Close Tag-->
</script>
<!--Close Tag-->
</head>
...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
What will be the output of given JavaScript code segment?
var myNum = 15;console.log(myNum.toString(8));
Explain as well.
Implement the following functions in JS:
When you press Check Email:
Display the information in a paragraph located in an element with a class named "Info":
Display the total number of elements in this HTML
Display all users who entered the information.
Check if the email is a Gmail email:
If not, turn the class "Alert" background to red.
Otherwise, do nothing.
When you press"Message Info":
Show a dialog box to the user showing the information to the user.
open a new window, redirect the user to "https://duckduckgo.com".
Please fix errors for the java code below. The program is a t square fractal (image below)
import javax.swing.*;import java.awt.*;import java.awt.geom.*;
//main classpublic class SquareFractal { public static void main(String[] args) { FractalFrame tframe = new FractalFrame(); tframe.setTitle("T Square Fractal"); tframe.setVisible(true); }}
//JFrame extended in fractal class class T_Fractal extends JFrame{ private JPanel panel; private int twidth, theight; private int x = 200; private int limit = 15;
public T_Fractal() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //default height and width final int Width = 1000; final int Height = 1000; setSize(Width, Height); setLocation(200,50);
panel = new JPanel(); Container t_content = getContentPane(); t_content.add(panel, "Center"); }
public void paint(Graphics graphics) { super.paint(graphics); Graphics2D g2 = (Graphics2D) graphics; twidth = getWidth(); theight = getHeight();…
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
- In this lab, you will use a timer to animate the movement of a heart image to the location where the mouse clicks, as shown below. In jacascript, please! The given web page shows a heart image. When the user clicks anywhere in the page, the startAnimation() function is called. startAnimation() determines where the user clicked and calls moveImage() with the clicked (x, y) coordinate. moveImage() moves the heart 1 pixel in the direction of the given (x, y) coordinates. Make the following JavaScript modifications using clearInterval() and setInterval() where appropriate: In startAnimation(), add an if statement that stops the timer with the ID timerId if timerId is not null. In startAnimation(), start a timer that calls moveImage(clickX, clickY) every 10 milliseconds. Save the timer ID in the timerId variable. Add an if statement in moveImage() that stops the timer with the ID timerId if (imgX, imgY) is equal to (centerX, centerY). Also set timerId to null. After the…arrow_forwardI need help modifying this Java code to match the picture. import java.awt.event.*; import javax.swing.*; class Main { public static void main(String args[]) { JFrame myframe= new JFrame("Message App"); JLabel lblMessage=new JLabel("Click SUBMIT for a message"); lblMessage.setBounds(100,88, 250,12); myframe.add(lblMessage); JButton btnSubmit=new JButton("Submit"); btnSubmit.setBounds(100,170, 88,30); myframe.add(btnSubmit); btnSubmit.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ lblMessage.setText("Welcome to Java Programming."); } }); JButton btnReset=new JButton("Reset"); btnReset.setBounds(244,170, 88,30); myframe.add(btnReset); myframe.setSize(400,400); myframe.setLayout(null); myframe.setVisible(true); } }arrow_forwardUsing comments within the code itself, can you provide an line by line explanation of the below JavaScript file? The file itself deals with WebGl and if that helps you. Please & thank you JavaScript File: function inverse2(m) { var a = mat2(); var d = det2(m); a[0][0] = m[1][1]/d; a[0][1] = -m[0][1]/d; a[1][0] = -m[1][0]/d; a[1][1] = m[0][0]/d; return a; } function inverse3(m) { var a = mat3(); var d = det3(m); var a00 = [ vec2(m[1][1], m[1][2]), vec2(m[2][1], m[2][2]) ]; var a01 = [ vec2(m[1][0], m[1][2]), vec2(m[2][0], m[2][2]) ]; var a02 = [ vec2(m[1][0], m[1][1]), vec2(m[2][0], m[2][1]) ]; var a10 = [ vec2(m[0][1], m[0][2]), vec2(m[2][1], m[2][2]) ]; var a11 = [ vec2(m[0][0], m[0][2]), vec2(m[2][0], m[2][2]) ]; var a12 = [ vec2(m[0][0], m[0][1]), vec2(m[2][0], m[2][1]) ]; var a20 = […arrow_forward
- 4.14 LAB: JavaScript game object Create an object called game in the script.js file. Add 2 properties: lives - initially 3, and coins - initially 0. Add a getter called points that returns coins * 10. Add a playerDies() method that subtracts 1 from lives if lives is greater than 0. Add a newGame() method that sets lives to 3 and coins to 0. The script.js file includes several console.log() statements, which should match the output below if the game object works correctly. lives = 3 coins = 0 points = 0 points = 20 lives = 2 lives = 0 lives = 3 coins = 0 View the program's output in the browser's JavaScript console.arrow_forwardWhen I am trying to display a text using the console.log() function in JavaScript then a newline character is printed automatically after the text. Please show me how I can print some text in JavaScript without printing a newline character.arrow_forwardWhat does c contain after running the following Javascript code? let a = [ 2, 3, 4, 5 ];let b = [ 1, 3, 5, 7, 9, 11];let c = b[a[1]]; a. undefined b. 0 c. 1 d. 2 e. 3 f. 4 g. 5 h. 7 i. 9 j. 11 k. Doesn't work due to syntax error.arrow_forward
- Using comments within the code itself, can you provide an line by line explanation of the below JavaScript file? The file itself deals with WebGl and if that helps you. Please and thank you JavaScript file: function MVbuffer(size) { var b = {}; b.buf = new Float32Array(size); b.index = 0; b.push = function(x) { for(var i=0; i<x.length; i++) { b.buf[b.index+i] = x[i]; } b.index += x.length; b.type = ''; } return b; } function isVector(v) { if(v.type == "vec2" || v.type == "vec3" || v.type == "vec4") return true; return false; } function isMatrix(v) { if(v.type == "mat2" || v.type == "mat3" || v.type == "mat4") return true; return false; } function radians( degrees ) { return degrees * Math.PI / 180.0; } //---------------------------------------------------------------------------- function patch() { var out = new Array(4); for(var i = 0; i< 4; i++) out[i] = new Array(4); out.type = "patch"; return out; } function curve() { var out = new Array(4); out.type = "curve";…arrow_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_forward3) Write a java program for displaying one flag at a time from nine countries flags. You may have a base Form with nine buttons (you may use Listview to trigger the events as well or any other method) and upon clicking one of the buttons (or selecting Listview item, or Combo box item) with the country name on it the image box / Label icon should display the country flag.arrow_forward
- Modify the following HTML code by adding JavaScript function so that when the user click on delete button, any button whose value is divisible by entered number cut out/removed from the page.Number entered in the divisible text field must be valid. [20 marks]HTML CODE:<div id="controls">Divisible by:<input type="text" id="divisor" /><button id="del">Delete</button></div> <div id="buttons">Click a button:<button>13</button> <button>66</button><button>24</button> <button>82</button><button>52</button> <button>93</button><button>61</button> <button>45</button><button>64</button> <button>105</button> </div>arrow_forwardLanguage c++: 1. Given string str is "Great", which choice has all matching expressions? Group of answer choices a. str == "Great" b. str == "Great", str == "great" c. str == "Great", str == "Great!" d. str == "Great", str == "great", str == "Great!" 2. What is the ending value of userString? (Note the question asks about userString, not about x). userString = "FaceBook";x = tolower(userString.at(4)); a. "Facebook" b. "FaceBook" c. "Faceook" d. "b" 3. Which expression evaluates to true if the corresponding characters of strings s1 and s2 are equal independent of case? Ex: "C" and "c" should be considered equal. Group of answer choices a. str1.at(i) == str2.at(i) b. str1.at((tolower(i)) == str2.at(tolower(i)) c. str1.at(i) == toupper(str2.at(i)) d. toupper(str1.at(i)) == toupper(str2.at(i)) 4. Given string str1 and string str2, which expression is true? str1 = "Hi";str2 = "Hello"; Group of answer choices a. str1 < str2 b. str1 >…arrow_forwardGiven 4 numbers (passed in as parameters) write a function that returns the average of these numbers please write this with a function in java form example function.somthing() and make an html file of the version as well please somthing like this function Numbers() { for (let i = 1; i <= 10; i++) { console.log(i);} } WITH OUT PYTHON PLZ WITHOUT THIS CODE and if there is no other way then that then please return my qus import java.util.Scanner; public class AverageClass { public static void main(String[] args) { int a, b, c, d; Scanner sc = new Scanner(System.in); System.out.print("Enter 4 numbers : "); a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt(); System.out.println("Average : " + average(a, b, c, d)); } static float average(int a, int b, int c, int d) { float sum; sum = a + b + c + d; return sum / 4; }}arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education