File tree Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change
1
+ //className & classList
2
+
3
+ first . className = "text-black red"
4
+ first . classList . add ( "red" )
5
+ first . classList . remove ( "red" )
6
+ first . classList . contains ( "red" )
7
+ first . classList . toggle ( "red" )
Original file line number Diff line number Diff line change 10
10
11
11
< body >
12
12
<!-- <span id="first" hidden><b>Hi</b>This is a span</span> -->
13
+ <!-- <script src="41_script.js"></script> -->
13
14
14
15
<!-- <div id="first" class="hey" data-game="mario" data-player="atul">
15
16
Hey I am first container
16
17
</div>
17
18
Hello world -->
19
+ <!-- <script src="42_script.js"></script> -->
18
20
19
21
<!-- I am start of this container (outer)
20
22
<div class="container">
23
25
I am end of this container (inner)
24
26
</div>
25
27
I am end of this container (outer) -->
28
+ <!-- <script src="43_script.js"></script> -->
26
29
27
- < div id ="first "> Hey I am first</ div >
30
+ <!-- <div id="first">Hey I am first</div> -->
31
+ <!-- <script src="44_script.js"></script> -->
28
32
29
- <!-- <script src="41_script.js"></script> -- >
30
- <!-- <script src="42_script.js"></script> -- >
31
- <!-- <script src="43_script.js"></script> -- >
32
- < script src ="44_script .js "> </ script >
33
+ < div id =" first " class =" yellow text-dark " >
34
+ < span > Hey I am good </ span >
35
+ </ div >
36
+ < script src ="45_script .js "> </ script >
33
37
34
38
</ body >
35
39
Original file line number Diff line number Diff line change 1
1
html , body {
2
2
height : 100% ;
3
3
width : 100% ;
4
+ }
5
+
6
+ .yellow {
7
+ background-color : yellow;
8
+ color : white;
9
+ }
10
+
11
+ .red {
12
+ background-color : red;
13
+ color : white;
14
+ }
15
+
16
+ .text-dark {
17
+ color : black;
4
18
}
You can’t perform that action at this time.
0 commit comments