-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.html
More file actions
87 lines (73 loc) · 1.78 KB
/
function.html
File metadata and controls
87 lines (73 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Function</title>
</head>
<body>
<!-- <form action="" method="POST"> -->
<!-- <label for="name">Name</label>
<input type="text" name="name" id="name" class=""><br/><br/>
<button name="getname" id="getname" class="" onclick="getdata()">Get Name</button>
-->
<!-- </form> -->
</body>
<script type="text/javascript">
//function name(){
//code
//}
//console.log("hello");
//window.alert("hello");
//1 manual function
// function printcon(){
// console.log("hello Mandalay");
// }
// printcon();
// function printalert(){
// window.alert("Hello Yandgon")
// }
// printalert();
//Parameter function
//Single Parameter Function
// function myfun1(city){
// console.log("Hello "+city);
// }
// myfun1("Bago");
//Value Request (Element)
// function getdata(){
// let name=document.getElementById("name").value;
// document.write(name);
// }
// function getdata(){
// let person="Mya Mya";
// let name=document.getElementById("name").value=person;
// }
//Multi Parameter function
// function multiplyfun(x,y,z){
// // console.log("x value is =" + x + "y value is" +y)
// let result = (x * y)+z;
// console.log("multiply result is =" + result);
// }
// multiplyfun(3,2,1);
//3 Constructor Function (By string)
// let fun1 = new Function("j","k","return j+k");
// let m =fun1(4,5);
// console.log(m);
// console.log(fun1(5,6));
//4 Nameless Function (Anonymous Function)
// let o =function (a){
// document.write("Hello Javascript =" +a);
// }();
//o(150);
//5 Self Invoking function
(function (){
console.log("Hello Yangon");
})();
</script>
</html>
<!--
1.manual function
2.parameter function (sigle parameter function & multi parameter function)
3. Constructor function
4.Nameless Function (Anonymous Function)
5.Self Invoking function
-->