-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.html
54 lines (51 loc) · 1.34 KB
/
javascript.html
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
<html>
<head>
<title>This is title</title>
<script>
function myfunc(){
document.getElementById("ab").innerHTML = "This is h2";
}
function myfunc1(){
document.getElementById("abc").innerHTML = "This is h3";
}
</script>
</head>
<body>
<p>This is para 1</p>
<h1 id="ab">This is h1</h1>
<h2 id="abc">This is h2</h2>
<h2 id="abcd">This is h2</h2>
<script>
<!-- alert("1+1=11"); -->
<!-- window.alert("1+1=2"); -->
document.getElementById("abc").innerHTML = ("thsi is 55555");
document.write("This is Document . write function");
console.log("This is console....................."+"<br>");
let x = 1;
var y,z;
y = 6;
z = x + y;
document.write("<br>value of z ="+z+"<br>");
let a = 5;
let b = 6;
let c = 7;
let d = a + b;
document.write(a*b+"<br>");
document.write(a**b+"<br>");
a+=10;
document.write(a/b+"<br>");
document.write(a-b+"<br>");
document.write(a+b+"<br>");
document.write(a|b+"<br>");
document.write(d+"<br>");
document.write(Math.pow(b,3));
let text = "Hello 123";
text += " World";
document.getElementById("ab").innerHTML = text;
</script>
<button onclick="window.print()">Print this page</button>
<button type="button" onclick="document.write(5 + 6)">Try it</button>
<button type="button" onclick="myfunc()">Click Here</button>
<button type="button" onclick="myfunc1()">Click Here</button>
</body>
</html>