Question

a) Create a new webpage, and call it mysecondpage.htm. Create a script in JavaScript within the...

a) Create a new webpage, and call it mysecondpage.htm. Create a script in JavaScript within the <BODY> portion of the page and have that script display an alert() dialog box with "mine". Try this script in at least two different web browsers.

b) Edit the webpage that you created in a), create a function within the <HEAD> portion of the page, and move the alert() dialog box that you currently have in the <BODY> script into your new function. Call the new function from the existing <BODY> script.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

Here new web page with name "mysecondpage.htm" is created which contains below code.

mysecondpage.htm :

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- title for web page -->

    <title>alert dialog</title>

    <!-- script is used for javascript -->

    <script>

    //function

    function callAlert()

    {

         //alert

         alert("mine");

    }

    </script>

</head>

<body>

    <!-- script is used for javascript -->

    <script>

       //call function

       callAlert();

    </script>

</body>

</html>

==================================

Output :Open web page mysecondpage.htm in the browser and will get the screen as shown below.

Screen 1:mysecondpage.htm, in google chrome

Screen 2:mysecondpage.htm, in microsoft edge

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
a) Create a new webpage, and call it mysecondpage.htm. Create a script in JavaScript within the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Write a JavaScript to create a. Alert Dialog Box b. Confirmation Dialog Box c. Prompt...

    2. Write a JavaScript to create a. Alert Dialog Box b. Confirmation Dialog Box c. Prompt Dialog box 3. Write a JavaScript to Change an image when a user holds down the mouse button. 4. Write a JavaScript to display all the cookies set on your machine. 5. Write a JavaScript to disable right click on the page

  • i need help with this homework webpage and code too: The webpage must include: Global Structure...

    i need help with this homework webpage and code too: The webpage must include: Global Structure Tags Text Tags Images   Your first page must be named index.html Include a table within your site, challenge yourself to add a header in the table, and choose interesting border and/or cell formatting. Include a hyperlink within your site. Include an image in your site. Include a form in your site to demonstrate understanding of a variety of form components (the form does not...

  • Create a webpage in which the user is allowed to select the page's background and color...

    Create a webpage in which the user is allowed to select the page's background and color whether the page uses serif or sans serif fonts. The change the body element's style attribute accordingly. If the user onclicks any of the options, the webpage will turn into that format. For example, if the user clicks "Gray background", the background color of the webpage will be Gray. If the user clicks Serif-text, the text in the web page will be in Serif...

  • Create a webpage (the last picture has three potential offers not just 2). Use html, JavaScript...

    Create a webpage (the last picture has three potential offers not just 2). Use html, JavaScript and CSS where needed. All information needed is supplied by the picture. Summary Create a dynamic web page that allows users to compare different financing offers for an automobile loan. Purchasers are often presented with different financing offers, and determining the best offer can be difficult. In particular, dealers often have promotions that offer either a lower interest rate or a cash incentive (sometimes...

  • <!DOCTYPE HTML> <html lang="en">    <title>JavaScript Array Lab</title>    <script src="script.js"></script>    <body>        <p>To...

    <!DOCTYPE HTML> <html lang="en">    <title>JavaScript Array Lab</title>    <script src="script.js"></script>    <body>        <p>To test your function, call divideArray() from the JavaScript console in the browser.</p>    </body> </html> Don't edit your code on the above code and do not copy from others', plz! // Put your solution here in script.js Write the function divideArray() in script.js that has a single numbers parameter containing an array of integers. The function should divide numbers into two arrays, evenNums for...

  • i need the code that goes within the <script> opening and closing following the insturctions of...

    i need the code that goes within the <script> opening and closing following the insturctions of the insturctions of the pasted assignment screen shots please. <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 3 Hands-on Project 3-1 Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Hands-on Project 3-1</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 3-1 </h1> </header> <article> <h2>Lunch selections</h2> <form> <input type="checkbox" id="item1" value="8" /> <label for="item1">Fried chicken ($8.00)</label> <input type="checkbox"...

  • Could you please help me write a Javascript code that will show a smiley face picture...

    Could you please help me write a Javascript code that will show a smiley face picture when I click the button. The picture should not display until the button is pressed. Here is my attempt at the code. It does not work. Please keep the code as simple as you can as I am new to coding. Please also use the <div> tag if possible, onclick and use the getElementById. Thank you <html> <body> <img id="exampleImage" src="smileyFace.png" /> <button onclick="pushButton()">Try...

  • Using JavaScript, I want to make a function that will open a new alert box that will say hello fi...

    Using JavaScript, I want to make a function that will open a new alert box that will say hello first name, last name after the person logs into the sign in form. This will happen aftrer the validation function is invoked. See code below. See the welcomefunction(). <!DOCTYPE html> <html> <head> <script> //validate the login form function validateForm() { var x = document.forms["LoginForm"]["fname"].value; //set x and y to first name and last name var y = document.forms["LoginForm"]["lname"].value; if (x ==...

  • I need help with my javascript project, I've started on it but I can't seem to...

    I need help with my javascript project, I've started on it but I can't seem to get ym java scripts to work with my index.html. Can someone please help me fix my code? I need the main.js & scratchpad.js to work with my index.html .Thank you Directions: Go to the following link: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics On that page, scroll down to "A 'hello world' example". Follow the step-by-step instructions to download their code and edit it in your text editor of choice....

  • in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript...

    in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 5 Hands-on Project 5-2 Author: Date:    Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Hands-on Project 5-2</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 5-2 </h1> </header> <article> <h2>Change of address form</h2> <form> <fieldset id="contactinfo"> <label for="addrinput"> Street Address </label> <input type="text" id="addrinput" name="Address" /> <label for="cityinput"> City </label> <input type="text" id="cityinput" name="City"...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT