Skip to content

Commit 06b8da1

Browse files
committed
update function
1 parent cd0150a commit 06b8da1

File tree

4 files changed

+56
-110
lines changed

4 files changed

+56
-110
lines changed

Example/FunctionExample/Example1.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

Example/FunctionExample/Example2.html

Lines changed: 0 additions & 43 deletions
This file was deleted.

Example/FunctionExample/Function2.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

Example/FunctionExample/function.html

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,65 @@
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>

0 commit comments

Comments
 (0)