File tree 3 files changed +25
-0
lines changed
JavaScript/Advance/DOM/1.window
3 files changed +25
-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 > window-BOM</ title >
9
+ < link rel ="shortcut icon " href ="images/js-logo.png " type ="image/x-icon ">
10
+ </ head >
11
+
12
+ < body >
13
+ < h1 style ="font-family: cursive; "> The width and height of your screen is:</ h1 >
14
+ < h2 id ="textOne " style ="font-family: monospace; "> </ h2 >
15
+ < script src ="script.js "> </ script >
16
+ </ body >
17
+
18
+ </ html >
Original file line number Diff line number Diff line change
1
+ let height = window . innerHeight ;
2
+ let width = window . innerWidth ;
3
+ let textOne = document . getElementById ( 'textOne' ) ;
4
+ textOne . innerHTML = `
5
+ <h2>Height: ${ height } px</h2>
6
+ <h2>Width: ${ width } px</h2>
7
+ `
You can’t perform that action at this time.
0 commit comments