File tree Expand file tree Collapse file tree
Html/Student Registration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "liveServer.settings.port" : 5501
3+ }
Original file line number Diff line number Diff line change 1+ let modeBtn = document . querySelector ( "#mode" ) ;
2+ let body = document . querySelector ( "body" ) ;
3+ let curmode = "light" //black
4+
5+ modeBtn . addEventListener ( "click" , ( ) => {
6+ if ( curmode === "light" ) {
7+ curmode = "dark" ;
8+ body . classList . add ( "dark" ) ;
9+ body . classList . remove ( "light" ) ;
10+ } else {
11+ curmode = "light" ;
12+ body . classList . add ( "light" ) ;
13+ body . classList . remove ( "dark" ) ;
14+ }
15+ console . log ( curmode ) ;
16+
17+ } )
18+
19+
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ <h2>Student Login</h2>
3737 < input type ="password " id ="password " name ="password " required > < br > < br >
3838
3939 < input type ="submit " value ="Login ">
40+ < button id ="mode "> Change Mode</ button >
4041 </ form >
42+ < script src ="demo.js "> </ script >
4143</ body >
4244</ html >
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ <h2>Student Registration</h2>
4040 < input type ="password " id ="password " name ="password " required > < br > < br >
4141
4242 < input type ="submit " value ="Register ">
43+ < button id ="mode "> Change Mode</ button >
4344 </ form >
45+ < script src ="demo.js "> </ script >
4446</ body >
4547</ html >
Original file line number Diff line number Diff line change 1+
2+ .dark {
3+ background-color : black;
4+ color : white;
5+ }
6+
7+
8+ .light {
9+ background-color : white;
10+ color : black;
11+ }
12+
13+
114body {
215 font-family : Arial, sans-serif;
316 background-color : # f0f8ff ;
@@ -34,6 +47,16 @@ input[type=submit]:hover {
3447 background-color : black;
3548}
3649
50+
51+ button {
52+ padding : 8px 15px ;
53+ background-color : # 007bff ;
54+ color : white;
55+ border : none;
56+ border-radius : 4px ;
57+ cursor : pointer;
58+ }
59+
3760ul {
3861 list-style-type : none; /* Remove bullet points */
3962 padding : 0 ;
You can’t perform that action at this time.
0 commit comments