Skip to content

Commit 9b553e8

Browse files
committed
compleate practice
0 parents  commit 9b553e8

4 files changed

Lines changed: 206 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# javascript-practice-6-

css/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* h3{
2+
background: linear-gradient(90deg, #1100ff ,#9d00ff);
3+
} */

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Class 22 practice</title>
7+
<link rel="stylesheet" href="css/style.css">
8+
</head>
9+
<body>
10+
11+
<div id="demo">
12+
<h1></h1>
13+
</div>
14+
<br>
15+
<br>
16+
<button onclick="add()">Add BG</button>
17+
<button onclick="r()">Radius</button>
18+
<button onclick="t()">text</button>
19+
<button onclick="c()">text center</button>
20+
21+
22+
<script src="js/script.js"></script>
23+
</body>
24+
</html>

js/script.js

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
// DOM ->Document Object Model
2+
3+
// let head = document.getElementById('demo')
4+
// head.innerHTML = 'hello'
5+
6+
// let head = document.getElementsByClassName('demo')
7+
// head[0].innerHTML = 'Saiful'
8+
9+
// let head = document.getElementsByTagName('h1')
10+
// head[0].innerHTML = 'adad'
11+
12+
// let head = document.querySelector('h1')
13+
// head.innerHTML = 'adksdn'
14+
15+
// let head = document.querySelector('.demo')
16+
// head.innerHTML = 'adksdn'
17+
18+
// let headings = document.querySelectorAll('h2')
19+
// console.log(headings);
20+
21+
// selecting attribute / set attribut
22+
23+
// let div = document.getElementById('demo')
24+
// // console.log(div.getAttribute('width'));
25+
// // console.log(div.getAttribute('height'));
26+
// div.innerHTML = '<h1>Hi</h1>'
27+
28+
29+
30+
// let input = document.querySelector('input')
31+
// // let h3 = document.querySelector('h3')
32+
// // console.log(input.value);
33+
// // console.log(h3.textContent);
34+
// input.setAttribute('value',10)
35+
36+
37+
function add () {
38+
let div = document.getElementById('demo')
39+
div.style.width = '200px'
40+
div.style.height = '200px'
41+
div.style.background = 'linear-gradient(90deg, #1100ff ,#9d00ff)'
42+
div.style.transition = 'all linear .3s'
43+
}
44+
function r() {
45+
let div = document.getElementById('demo')
46+
div.style.borderRadius = '50%'
47+
div.style.transition = 'all linear .3s'
48+
}
49+
function t() {
50+
let div = document.getElementById('demo')
51+
div.innerHTML = 'SAIFUL'
52+
div.style.color = 'red'
53+
div.style.fontSize = '50px'
54+
div.style.transition = 'all linear .3s'
55+
}
56+
function c() {
57+
let div = document.getElementById('demo')
58+
div.style.textAlign = 'center'
59+
div.style.lineHeight = '200px'
60+
div.style.color = 'white'
61+
div.style.background = 'linear-gradient(90deg, #ff5900ff ,#9d00ff)'
62+
div.style.transition = 'all linear .3s'
63+
}
64+
65+
// events
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
114+
115+
116+
117+
118+
119+
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
135+
136+
137+
138+
139+
140+
141+
142+
143+
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+
178+

0 commit comments

Comments
 (0)