Professional Documents
Culture Documents
IT8501 WT Topic21
IT8501 WT Topic21
Visual PPT
Kinesthetic Workbook
@Visual: What are you going to show the students to learn in the class? –
Example: PPT, a video with or without audio, a model, a demonstration, etc.
*Audio: What are you going to make the student listen in the class?
Example: You live explanation, a recorded audio, a video with audio
#Kinesthetic: What are you going to make the students do physically in the
class?
Example: Use a workbook and make them work on it and learn by doing
_______________________________________________________________
$ as per the course plan and will vary based on the credits
STEP 2: ACQUISITION
(The subtopics under the main topic being handled are listed. Under each sub topic, the entire
detail is to be prepared. This helps in handling the class with focus and confidence).
Write a program to remove the child node from the HTML DOM
<!DOCTYPE html>
<html>
<body>
<div id="div1">
<p id="p1">This is a paragraph.</p>
<p id="p2">This is another paragraph.</p>
</div>
<script>
var parent = document.getElementById("div1");
var child = document.getElementById("p1");
parent.removeChild(child);
</script>
</body>
</html>
3.4.2.5 Replacing HTML Elements
To replace an element to the HTML DOM, use the replaceChild() method:
Write a program to replacing the HTML elements
<!DOCTYPE html>
<html>
<body>
Example: Write a DHTML Program to change the HTML Style Using DOM
<html>
<body>
<p id="p2">Hello World!</p>
<script>
document.getElementById("p2").style.color = "blue";
</script>
<p>The paragraph above was changed by a script.</p>
</body>
</html>
3.5. The Document Tree:
Each HTML document can actually be referred to as a document tree. We describe the
elements in the tree like we would describe a family tree. There are ancestors,
descendants, parents, children and siblings.It is important to understand the document
tree because CSS selectors use the document tree.Use the sample HTML document
below for these examples. The <head> section of the document is omitted for brevity.
<html><body>
<html>
<body>
<div id="content">
<h1>Heading here</h1>
<p>Lorem ipsum dolor sit amet.</p>
<p>Lorem ipsum dolor <em>sit</em> amet.</p>
<hr>
</div>
<div id="nav">
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
</div><body></html>
A diagram of the above HTML document tree would look like this.
3.5.2 Descendant
A descendant refers to any element that is connected but lower down the document tree -
no matter how many levels lower.In the diagram below, all elements that are connected
below the <div> element are descendants of that <div>.
+
Figure 3.4 : DOM Tree with Descendant
3.5.3.Parent and Child
A parent is an element that is directly above and connected to an element in the document
tree. In the diagram below, the <div> is a parent to the <ul>.A child is an element that is
directly below and connected to an element in the document tree. In the diagram above,
the <ul> is a child to the <div>.
1. The HTML DOM model is constructed as a tree of Objects. In the HTML DOM
(Document Object Model), everything is a _________
2. When a web page is loaded, the browser creates a Document Object Model of the page. In
the HTML DOM, the _________ represents an HTML attribute.
3. The HTML DOM model is constructed as a tree of _____________
4. To remove an HTML element, ________ method is used.
5. To replace an element to the HTML DOM, _________ method is used.
6. Write the syntax to change the style of an HTML element.