File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed 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
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
7
+ < title > Document</ title >
8
+ < script defer src ="script.js "> </ script >
9
+
10
+ </ head >
11
+ < body >
12
+
13
+ < input id ="name ">
14
+ < button id ="greet "> Greet</ button >
15
+
16
+ </ body >
17
+ </ html >
Original file line number Diff line number Diff line change
1
+ window . onload = function ( ) {
2
+
3
+ let x = document . getElementById ( 'name' )
4
+ let y = document . getElementById ( 'greet' )
5
+
6
+ y . onclick = function ( ) {
7
+ window . alert ( 'Hello ' + x . value )
8
+ }
9
+ }
Original file line number Diff line number Diff line change 5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
7
7
< title > Document</ title >
8
- < script src ="functions .js "> </ script >
8
+ < script src ="myfile .js "> </ script >
9
9
</ head >
10
10
< body >
11
11
12
+ < h1 > my page</ h1 >
12
13
13
14
14
15
</ body >
You can’t perform that action at this time.
0 commit comments