-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdom.html
66 lines (45 loc) · 1.36 KB
/
dom.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!--/* DOM(document object model) */
//all text in html is object and accessible through JS
//DOM is a tree, consists of nodes, parent nodes and child nodes.
//the root node is document and has only one child HTML
//can react all the event in the HTML page and you can create or change any event in the webpage.
//HTML element has two children body and head:- under head title and under body paragraph
//can change any html elements and its attributes
//is a standard object model and programming interface for HTML
//methods to access HTML elements and EVENTS for html elements
//properties are values, elements are objects
//methods are action perform on the html element
//can add and change CSS styling
//called client side scripting.
//uses HTML and CSS
//use graphical interface-->
<!--example to how to access HTML elements using DOM:-
using method GET ELEMENT BY ID -->
<!--Example-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>DOM</title>
<style>
.submit{
padding: 1em 4em;
font-size: 1em;
background-color: black;
color: crimson;
}
</style>
</head>
<body>
<input type="submit"/>
<div class="div1">
<p class="para"></p>
<p id="para1"></p>
</div>
<div class="content">
<p id="p"></p>
<p id="p"></p>
</div>
<script src="./Dom.js">
</script>
</body>
</html>