File tree 3 files changed +57
-0
lines changed
3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ let $counter = document . getElementById ( 'counter' ) ;
2
+ let $windowWidth = document . getElementById ( 'windowWidth' ) ;
3
+ let $comments = document . getElementById ( 'comments' ) ;
4
+
5
+ // console.dir(window);
6
+
7
+ function windowWidth ( ) {
8
+ // console.log(window.outerWidth);
9
+ $windowWidth . innerHTML = window . outerWidth + 'px' ;
10
+ }
11
+ function walkerWalks ( ) {
12
+ window . location . href = 'http://walker-walks.com' ;
13
+ }
14
+
15
+ // window.document = document
16
+ function countUp ( ) {
17
+ let c = $counter . innerHTML ;
18
+ c ++ ;
19
+ $counter . innerHTML = c ;
20
+ }
21
+
22
+
23
+ function addComment ( ) {
24
+ let greet = document . createElement ( 'p' ) ;
25
+ let msg = document . createTextNode ( 'Hello' ) ;
26
+
27
+ $comment . appendChild ( greet ) . appendChild ( msg ) ;
28
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Learning JavaScript - Walker</ title >
6
+ < link rel ="stylesheet " href ="style.css ">
7
+ </ head >
8
+ < body >
9
+ < h1 > DOM(Document Object Model)</ h1 >
10
+ < p >
11
+ Interface(a way to access) to HTML for JavaScript. < br >
12
+ To Control Properties/Methods/Events
13
+ </ p >
14
+ < p >
15
+ < button onclick ="windowWidth(); "> Window Width</ button > : < span id ="windowWidth "> ?</ span > < br >
16
+ </ p >
17
+ < p >
18
+ Count: < span id ="counter "> 0</ span >
19
+ < button onclick ="countUp(); "> add</ button >
20
+ </ p >
21
+ < p id ="comments ">
22
+ < button onclick ="addComments "> Add Commnets</ button >
23
+ </ p >
24
+ < button onclick ="walkerWalks(); "> visit Walker Walks</ button > < br >
25
+
26
+
27
+ < script src ="app.js "> </ script >
28
+ </ body >
29
+ </ html >
You can’t perform that action at this time.
0 commit comments