




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various aspects of web development, including the document object model (dom), html headings, background image integration, css incorporation methods, table styling, and javascript functionalities. It provides detailed explanations, sample code, and step-by-step instructions to help students and developers understand and implement these concepts. Topics such as dynamic content updates, scrolling text, video integration, and tabular data presentation. It serves as a comprehensive resource for understanding the fundamental building blocks of web development, empowering learners to create interactive and visually appealing web pages.
Typology: Exercises
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Q1. What is document object model? Explain with the help of an example? The Document Object Model (DOM) is a programming interface for web documents. It represents the structure of a web page in a hierarchical tree format, where each element, attribute, and piece of text is a node in this tree. The DOM allows programming languages like JavaScript to interact with and manipulate the content and structure of web pages dynamically. Basic Structure of the DOM: i. Document: The root node representing the entire document. ii. Elements: Nodes representing HTML tags, such as ,
, , etc. iii. Attributes: Nodes representing attributes of HTML elements, such as class, id, and href. iv. Text: Nodes representing the text content inside elements. Example: Consider the following HTML snippet:
My Web Page
Welcome to My Web Page
This is a paragraph.
Click hereIn this example, the DOM structure would look like this: Document โโโ html โโโ head โ โโโ title โ โโโ "My Web Page" โโโ body โโโ h โ โโโ "Welcome to My Web Page" โโโ p โ โโโ "This is a paragraph." โโโ a โโโ "Click here" โโโ href="https://www.example.com" Q2. Write the code to differentiate between different types of headings in HTML. The to tags are used to define HTML headings. defines the most important heading. defines the least important heading. Note: Only use one per page - this should represent the main heading/subject for the whole page.
The main keyword of the whole content of a webpage should be display by h1 heading tag.You can specify background images
for any visible HTML element.
Q4. With the help of sample code, highlight different methods to incorporate CSS code in a HTML page. Ans. Following are the different methods to incorporate CSS code in a HTML page.
Table With Border
Use the CSS border property to add a border to the table.
Firstname Lastname Age
Zohaib Khan 50
Shoaib Ali 94
Sadia Hussain 80
Q6. Discuss the functionality JavaScript can provide in a web page with the help of suitable example code. Ans. JavaScript is used in development of webpages & scripts. It doesnโt consume much of memory and that is why it is used at the client end in developing websites, for making pages dynamic. JavaScript enhances web pages by enabling dynamic interactions and functionalities. Hereโs a short example illustrating its capabilities: Example: Dynamic Content Update
JavaScript can modify the content of a web page without reloading it. For instance, you can use it to change text or add elements based on user actions. HTML:
What Can JavaScript Do?
JavaScript can change HTML content.
Click Me!This simple example demonstrates how JavaScript can make web pages interactive and responsive to user actions. Q7. Articulate steps and write code to create a scrolling text on web page.
This is a sample scrolling text that has scrolls in the upper direction.
Note: direction can be up, down, left or right.
Result Name Class & Section
Subject Max Marks Obtained Marks %age
Maths 100 50 50 %
Urdu 75 52 69.4 %
English 75 63 84 %
Q10. In the context of fig. 40(d) , add another button namely โRevertโ which when in pressed, it will reverse both color & index values.
Ascending Order