File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
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+ < title > Document</ title >
7+ < script src ="Functions.js "> </ script >
8+ </ head >
9+ < body >
10+ < button onclick ="info() "> Click</ button >
11+
12+ < input type ="text " id ="num1 ">
13+ < input type ="text " id ="num2 ">
14+
15+ < button onclick ="add() "> Print Add</ button >
16+
17+ < h1 > Result < span id ="print_result "> </ span > </ h1 >
18+
19+ </ body >
20+ </ html >
Original file line number Diff line number Diff line change 1+ function info ( ) {
2+ // function body
3+ alert ( "welcome to codeswithpankaj" )
4+ }
5+
6+ function add ( ) {
7+
8+ num1 = document . getElementById ( "num1" ) . value ;
9+ num2 = document . getElementById ( "num2" ) . value ;
10+
11+ num1 = parseInt ( num1 ) ;
12+ num2 = parseInt ( num2 ) ;
13+
14+ result = num1 + num2 ;
15+
16+ document . getElementById ( "print_result" ) . innerHTML = result ;
17+
18+
19+ }
You can’t perform that action at this time.
0 commit comments