-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignment_operators.html
73 lines (56 loc) · 1.32 KB
/
assignment_operators.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<body>
<h2>The Addition Operator +=</h2>
<p>var x = 10</p>
<p>x += 5</p>
<p id="demo_plus_eqls"></p>
<h2>The Subtraction Operator -=</h2>
<p>var a = 10</p>
<p>a -= 5</p>
<p id="demo_mnus_eqls"></p>
<h2>The Multiplication Operator *=</h2>
<p>var b = 10</p>
<p>b *= 5</p>
<p id="demo_mply_eqls"></p>
<h2>The Division Operator /=</h2>
<p>var c = 10</p>
<p>c /= 5</p>
<p id="demo_divd_eqls"></p>
<h2>The Remainder Operator %=</h2>
<p>var y = 10</p>
<p>y %= 4.5</p>
<p id="demo_pcnt_eqls"></p>
<h2>The Exponentiation Operator **</h2>
<p>var z = 10</p>
<p>z = z ** 3</p>
<p id="demo_expn"></p>
<h2>Using The Addition Operator to Concatenate Strings +=</h2>
<p>var q = "Concatenate "</p>
<p>q += "Strings"</p>
<p id="demo_cnct"></p>
<script>
var x = 10;
x += 5;
document.getElementById("demo_plus_eqls").innerHTML = x;
var a = 10;
a -= 5;
document.getElementById("demo_mnus_eqls").innerHTML = a;
var b = 10;
b *= 5;
document.getElementById("demo_mply_eqls").innerHTML = b;
var c = 10;
c /= 5;
document.getElementById("demo_divd_eqls").innerHTML = c;
var y = 10;
y %= 4.5;
document.getElementById("demo_pcnt_eqls").innerHTML = y;
var z = 10;
z = z ** 3;
document.getElementById("demo_expn").innerHTML = z;
var q = "Concatenate ";
q += "Strings";
document.getElementById("demo_cnct").innerHTML = q;
</script>
</body>
</html>