-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_sample.html
More file actions
44 lines (34 loc) · 1.07 KB
/
function_sample.html
File metadata and controls
44 lines (34 loc) · 1.07 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Function in javascript</title>
</head>
<body>
<h2>javascript Functions</h2>
<p>This Example calls a funtion which performs a calculation,and returns the result:</p>
<p id="demo"></p>
<h1 id="trial"></h2>
<p id="test"></p>
<script type="text/javascript">
function getname()
{var name =prompt("Adınızı Giriniz")
return name}
function selamver(){
var deger = prompt("Bir Değer Giriniz")
return deger
alert(deger)}
function myFunction(a, b) {
return a * b
}
var x = myFunction(4, 3);
document.getElementById("demo").innerHTML = x ;
var y = selamver()
document.getElementById("trial").innerHTML = y ;
if(x==y)
{document.getElementById("trial").innerHTML ="değerlisin " + getname()}
else
{document.getElementById("trial").innerHTML="değersizsin " + getname()}
</script>
</body>
</html>