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.
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
Related questions
Question
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:
Step by step
Solved in 3 steps with 2 images
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.Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L