File tree Expand file tree Collapse file tree 4 files changed +56
-110
lines changed
Expand file tree Collapse file tree 4 files changed +56
-110
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33< head >
44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
67 < title > Document</ title >
7- < script >
8- // create a function
9- function info ( ) {
10-
11- alert ( "welcome to codeswithpankaj.com" )
12-
13- }
14- //calling
15- info ( )
16-
17- // with arg function
18- function product ( price , qt ) {
19- total_price = price * qt
20- document . write ( "<hr>" + "total = " + total_price + "<hr>" )
21- }
22- // calling
23- product ( 1200 , 3 )
24- </ script >
8+
9+ < script >
10+
11+ //function
12+
13+ // basic function
14+
15+ function get_info ( ) {
16+
17+ console . log ( "welcome to : codeswithpankaj.com" ) ;
18+
19+ }
20+
21+ // calling function
22+
23+ get_info ( ) ;
24+
25+
26+ // function with arg.
27+
28+
29+ function user_info ( Name , age ) {
30+ console . log ( "your name is : " + Name ) ;
31+ console . log ( "your age is : " + age )
32+ }
33+
34+ // calling function
35+
36+ user_info ( "joy" , 23 ) ;
37+
38+ // with return type
39+
40+ function set_number ( ) {
41+
42+ return 900 ;
43+ }
44+
45+ // print function value
46+ console . log ( set_number ( ) )
47+
48+
49+ function msg ( ) {
50+ alert ( "welcome tp p4n.in" ) ;
51+ }
52+
53+ </ script >
54+
55+ < button onclick ="msg() "> Show alert</ button >
56+
2557</ head >
2658< body >
59+
60+
61+
62+
63+
64+
2765
2866</ body >
2967</ html >
You can’t perform that action at this time.
0 commit comments