Lab Exercisel Design a web page to and display the text "Welcome to Oman" using java seript. Try the different methods of including javaseript into a web page.

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter1: Getting Started With Html5: Creating A Website For A Food Vendor
Section: Chapter Questions
Problem 2CP3
icon
Related questions
Question
Lecture 3
Java Script (Introduction)
Lab Exercisel
Design a web page to and display the text "Welcome to Oman" using java script.
Try the different methods of including javascript into a web page.
Lab Exercise 2
Find the HTML element (with id%3"demo"), and changes the element content (innerHTML) to the
current date and time value:
cre
Lab Exercise 3
Find the HTML element (with id%3D"demo"), and changes the element content (innerHTML) to "Hello
JavaScript":
Lab Exercise 4
Design one HTML page with that will print the sum and product of two integer numbers with the help
of javascript variables.
Lab Exercise 5
Program to demonstrate the use of javascript Alert box.
Lab Exercise 6
Program to demonstrate the use of javascript Confirm box.
Lab Exercise 7
Program to demonstrate the use of javascript Prompt box.
Page 4 of 8
Transcribed Image Text:Lecture 3 Java Script (Introduction) Lab Exercisel Design a web page to and display the text "Welcome to Oman" using java script. Try the different methods of including javascript into a web page. Lab Exercise 2 Find the HTML element (with id%3"demo"), and changes the element content (innerHTML) to the current date and time value: cre Lab Exercise 3 Find the HTML element (with id%3D"demo"), and changes the element content (innerHTML) to "Hello JavaScript": Lab Exercise 4 Design one HTML page with that will print the sum and product of two integer numbers with the help of javascript variables. Lab Exercise 5 Program to demonstrate the use of javascript Alert box. Lab Exercise 6 Program to demonstrate the use of javascript Confirm box. Lab Exercise 7 Program to demonstrate the use of javascript Prompt box. Page 4 of 8
Expert Solution
Program Approach

NOTE: YOU HAVE POSTED A LOT OF QUESTIONS, OUT OF WHICH ONLY FIRST ONE WILL BE SOLVED. IF YOU WISH FOR SOME PARTICULAR QUESTION TO BE SOLVED, PLEASE MENTION IT BY POSTING A NEW QUESTION

For type 1:

  • Define the type of document as html
  • Define html tag
  • Define body tag for main text
  • Define heading with type h2
  • Define paragraph id as ex
  • Define script tag
  • Use document.getElementById to print the data
  • End script tag
  • End body tag
  • End html tag

For type 2:

  • Define document type as HTML
  • Define html tag
  • Define body tag
  • Define heading
  • Define script tag
  • use document.write for printing data
  • end script tag
  • end body tag
  • end html tag
Program for Lab 1 :Type 1

<!DOCTYPE html>

<html>  <!-- html tag -->

<body>  <!-- body tag  -->

<h2>My Web Page</h2> <!--heading  -->

<p id="ex"></p> <!-- paragraph id -->

<script>  <!-- start script -->

document.getElementById("ex").innerHTML = "Welcome to Oman"; <!--call element from p id -->

</script> <!-- end script  -->

</body> <!--  end body tag-->

</html> <!--end html tag  -->

OUTPUT:

Computer Science homework question answer, step 2, image 1

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
External Style Sheet
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
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L