File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
JavaScript/Advance/DOM/2.screen Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
7+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
8+ < title > screen-BOM</ title >
9+ < link rel ="stylesheet " href ="style.css ">
10+ < link rel ="shortcut icon " href ="images/js-logo.png " type ="image/x-icon ">
11+ </ head >
12+
13+ < body >
14+ < h1 > Screen in BOM</ h1 >
15+ < button id ="button " onclick ="DisplayOne() "> Click Here to view your screen Size</ button >
16+ < div id ="textOne ">
17+
18+ </ div >
19+ < script src ="script.js "> </ script >
20+ </ body >
21+
22+ </ html >
Original file line number Diff line number Diff line change 1+ let textOne = document . getElementById ( 'textOne' ) ;
2+ let button = document . getElementById ( 'button' ) ;
3+
4+ button . addEventListener ( "click" , ( ) => {
5+ return (
6+ textOne . innerHTML = `
7+ <p>Windows Screen: ${ window . screen } </p>
8+ <p>Windows Screen: ${ screen . height } </p>
9+ <p>Windows Screen: ${ screen . width } </p>
10+ <p>Available Screen Width: ${ screen . availWidth } </p>
11+ <p>Available Screen Height: ${ screen . availHeight } </p>
12+ <p>Screen Color Depth: ${ screen . colorDepth } </p>
13+ <p>Screen Pixel Depth: ${ screen . pixelDepth } </p>
14+ ` )
15+ } )
Original file line number Diff line number Diff line change 1+ p {
2+ font-family : cursive;
3+ }
4+
5+ button {
6+ background-color : transparent;
7+ border : 1px solid green;
8+ font-size : 25px ;
9+ padding : 10px 20px ;
10+ border-radius : 8px ;
11+ }
12+
13+ button : hover {
14+ background-color : green;
15+ color : white;
16+ transition : all ease 0.5s ;
17+ }
You can’t perform that action at this time.
0 commit comments