-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1095 lines (834 loc) · 26.5 KB
/
Copy pathindex.html
File metadata and controls
1095 lines (834 loc) · 26.5 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>java SCript Basic Full Course 1-1-2023</title> <!--<<pre>>-->
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<div id="wel">
<h1 id="well" >Welcome to JavaScript Course with Sultan Muhammad Essa 514</h1>
</div> <br>
<!-- content portion -->
<div id="content">
<h1>Content</h1>
<pre>
<h3>
<li><a href="#intro">JavaScript Introduction page (1) code line (45)</a></li>
<li><a href="#whereto">WhereTo page (2) code line (62)</a></li>
<li><a href="#output">Output page (3) code line (177)</a></li>
<li><a href="#JavaScripSyntax">JavaScript Syntax page (4) code line (293)</a></li>
<li><a href="#javascriptcoment">JavaScript Comment page (5) code line (340)</a></li>
<li><a href="#javascriptVariable">JavaScript Variable page (6) code line (389)</a></li>
<li><a href="#operators">JavaScript Operators page (7) code line (480)</a></li>
<li><a href="#arithmetic">JavaScript Arithmetic Operators page (8) code line (811)</a></li>
<li><a href="#assignment">JavaScript Assignment Operators page (9) code line (951)</a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</h3>
</pre>
</div>
<br><br><br>
<!-- introduction portion -->
<!-- intro,whereto,output,JavaScripSyntax,javascriptcoment,javascriptVariable -->
<div id="intro">
<h6>1</h6>
<h1>JavaScript Introduction</h1> <br><br>
<h3>JavaScript is the most popular programming language in the world. <br>
JavaScript is the programming language of HTML and the Web. <br>
Programming makes computers do what you want them to do. <br>
JavaScript is easy to learn. <br> <br>
<li>java script can change html content</li>
<li>java script can change html Attribute</li>
<li>java script can change html Style CSS</li>
</h3>
<!-- WhereTo portion-->
</div><br><br>
<div id="whereto">
<h6>2</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3>
<h1>The <"script"> Tag</h1>
<h4>In HTML, JavaScript code must be inserted between <"script"> and <"/script"> tags.</h4> <br><br>
Example:=: <br><br>
<pre>
<xmp>
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
</xmp>
</pre> <br><br>
<h1>JavaScript in <"head"></h1>
<h4>In this example, a JavaScript function is placed in the <"head"> section of an HTML page.
The function is invoked (called) when a button is clicked:</h4> <br><br>
<!-- new headings -->
<xmp>
Example
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</head>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
</ body>
</html>
</xmp>
<!-- new headings -->
<h1>JavaScript in <"body"></h1>
<h4>In this example, a JavaScript function is placed in the <"body"> section of an HTML page. <br>
The function is invoked (called) when a button is clicked:</h4>
<xmp>
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</ body>
</html>
</xmp>
<!-- new headings -->
<h1>External JavaScript </h1>
<h4>Scripts can also be placed in external files.
External scripts are practical when the same <br>
code is used in many different web pages.
JavaScript files have the file extension .js.
To use an external script, put the name of the script <br>
file in the src (source) attribute of the <"script"> tag:</h4>
<xmp>
<!DOCTYPE html>
<html>
<body>
<script src="myScript.js"></script>
</ body>
</html>
</xmp>
<!-- new headings -->
<h1>External JavaScript Advantages </h1>
<h4>Placing JavaScripts in external files has some advantages:
<li>It separates HTML and code </li>
<li>It makes HTML and JavaScript easier to read and maintain </li>
<li>Cached JavaScript files can speed up page loads</li>
</h4>
</div> <br><br>
<!-- javascript output -->
<div id="output">
<h6>3</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3>
<!-- new headings -->
<h1>JavaScript Output</h1>
<br>
<h1>JavaScript Display Possibilities</h1>
<h4>JavaScript can "display" data in different ways:</h4> <br>
<ul>
<li>Writing into an alert box, using window.alert().</li>
<li>Writing into the HTML output using document.write().</li>
<li>Writing into an HTML element, using innerHTML.</li>
<li>Writing into the browser console, using console.log().</li>
</ul>
<br>
<!-- new headings -->
<h1>Using window.alert()</h1>
<h4>You can use an alert box to display data:</h4> <br>
Example:
<xmp>
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
window.alert("Can you want to learn JavaScript");
</script>
</body >
</html>
</xmp>
<br><br>
<!-- new headings -->
<h1>Using document.write()</h1>
<h4>For testing purposes, it is convenient to use document.write():: </h4> <br><br>
Example:
<xmp>
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
document.write(5 + 6);
</script>
</body >
</html>
</xmp>
<br><br>
<!-- new headings -->
<h1>Using innerHTML</h1>
<h4>To access an HTML element, JavaScript can use the document.getElementById(id) method. <br>
The id attribute defines the HTML element. The innerHTML property defines the HTML content:</h4> <br><br>
Example::
<xmp>
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 5 + 6;
</script>
</body >
</html>
</xmp>
<br><br>
<!-- new headings -->
<h1>Using console.log()</h1>
<h4>In your browser, you can use the console.log() method to display data. <br>
Activate the browser console with F12, and select "Console" in the menu.</h4> <br><br>
Example:
<xmp>
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
console.log(1 + 6);
</script>
</body >
</html>
</xmp>
</div> <br>
<!-- new portion start -->
<div id="JavaScripSyntax">
<h6>4</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3><br><br>
<h1>JavaScript Syntax</h1> <br><br><br>
<h1>JavaScript Programs </h1><br><br>
<h4>A computer program is a list of "instructions" to be "executed" by the computer. <br>
In a programming language, these program instructions are called statements.
JavaScript is a programming language.
JavaScript <br> statements are separated by semicolons.</h4> <br><br>
Example:
<xmp>
var x = 5;
var y = 6;
var z = x + y;
</xmp> <br> <br>
<!-- new headings -->
<h1>JavaScript Statements</h1>
<h4>JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.</h4> <br><br>
<!-- new headings -->
<h1>JavaScript Values</h1>
<h4>The JavaScript syntax defines two types of values: Fixed values and variable values.
Fixed values are called literals. Variable values are called variables.</h4>
<!-- new headings -->
<h1>JavaScript Literals</h1>
<h4>The most important rules for writing fixed values are: <br>
Numbers are written with or without decimals: <br> <br><br>
example of numbers: <br>
7,14,12
<br> <br><br>
Strings are text, written within double or single quotes: <br><br>
Example of String <br><br>
"Sultan" <br><br>
"Muhammad" <br><br><br>
</h4>
</div>
<!-- new portion -->
<div id="javascriptcoment">
<h6>5</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3>
<!-- new headings -->
<h1>JavaScript Comments</h1>
<h4>avaScript comments can be used to explain JavaScript code, and to make it more readable. <br>
JavaScript comments can also be used to prevent execution, when testing alternative code.</h4> <br><br>
<!-- new headings -->
<h1>Single Line Comments </h1>
<h4>Single line comments start with //.
Any text between // and the end of the line, will be ignored by JavaScript (will not be executed). <br>
This example uses a single line comment before each line, to explain the code:</h4>
Example: <br>
<xmp>
// Change heading:
document.getElementById("myH").innerHTML = "My First Page";
// Change paragraph:
document.getElementById("myP").innerHTML = "My first paragraph.";
</xmp>
<br><br>
<!-- new headings -->
<h1>Multi-line Comments</h1>
<h4>Multi-line comments start with /* and end with */.
Any text between /* and */ will be ignored by JavaScript.
This example uses a multi-line comment (a comment block) to explain the code:</h4>
Example: <br>
<xmp>
/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
in my web page:
*/
document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";
</xmp>
</div><br><br><br><br>
<div id="javascriptVariable">
<h6>6</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3> <br><br>
<!-- new headings -->
<h1>JavaScript Variables</h1> <br>
<h4>
JavaScript variables are containers for storing data values.
In this example, x, y, and z, are variables: <br><br>
There are theee type of variable such as: <li>Let</li><li>Const</li><li>Var ::ab sa phala wala variable(var ha)</li> </h4> <br><br>
Example: <br>
<xmp>
var x = 5;
var y = 6;
var z = x + y;
</xmp> <br><br>
<h4>
From the example above, you can expect: <br>
<li>x stores the value 5</li>
<li>y stores the value 6</li>
<li>z stores the value 11</li>
</h4> <br><br>
<!-- new headings -->
<h1>Data Types</h1> <br>
<h4>There are two types of data types such as</h4>
<h4><li>primitive data type</li> <li>non primitive data type</li></h4>
<br><br>
<h1>Primitive Data Type</h1> <br>
<h4>there are five types of primitive data type Such as <br><br>
<li>String</li>
<li>Number</li>
<li>Booleans</li>
<li>undefine</li>
<li>null</li> <br><br>
</h4>
<!-- new headings -->
<h1>String</h1> <br><br>
<h4>A string can be any text inside double or single quotes like "sultan" sultan is a string</h4> <br>
Example of String: <br> <br>
<li>"Sultan"</li>
<li>"Muhammad"</li>
<li>"Essa"</li> <br><br>
<!-- new headings -->
<h1>Number</h1> <br><br>
<h4>
Example: <br><br>
<li>1</li>
<li>51</li>
<li>7</li>
</h4> <br><br>
<h1>Booleans</h1> <br>
<h4>Boleans which basically means they can be true or false ,on or off and close or open etc .</h4> <br>
<li>True</li>
<li>False</li> <br><br>
<!-- new headings -->
<h1>undefine</h1>
<h4>A variable that has not been assigned a value</h4> <br><br>
Example:: <br><br>
<li>let a;</li> <br><br>
<!-- new headings -->
<h1>Null</h1>
<h4>'Null' is a keyword in JavaScript that signifies 'no value' or nonexistence of any value.</h4> <br><br>
Example: <br><br>
let a=null;
<br><br>
<!-- new headings -->
<h1>Primitive Data Type</h1> <br><br>
<h4>Such a data which is not easily changed, means data is changed in difficult way <br>
There are two tyes of primitive data type
<li>Array</li>
<li>Object</li>
</h4> <br><br>
<!-- new headings -->
<h1>Array</h1><br><br>
<h4>An array is a special variable, which can hold more than one value at a time. The Syntax of array is different from object An array is start from square brackets.</h4> <br><br>
Example: <br>
<xmp>
let arry(variable name which u want)=["Sultan","Muhammad","Essa"]
Note:for more detail please visit portion.
</xmp> <br><br>
<!-- new headings -->
<h1>Object</h1><br><br>
<h4>An object is a special variable which can hold more than one value at a time.The syntax of array is different from array object is start with curly brackets</h4> <br><br>
Example: <br>
<xmp>
let obj={
Fname:"Sultan"
Mname:"Muhammad"
Lname:"Essa-514"
}
</xmp>
</div> <br><br>
<br> <br>
<!-- new portion -->
<div id="operators">
<h6>7</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3> <br><br>
<!-- new headings -->
<h1>JavaScript Operators</h1> <br><br>
<h1>JavaScript Arithmetic Operators</h1> <br><br>
<h4>Arithmetic operators are used to perform arithmetic on numbers (literals or variables).</h4> <br><br>
<table border="5px" style="margin: 0 auto;color: greenyellow; border: 3px solid red;" >
<th>
<tr>
<td>operator</td>
<td>Description</td>
</tr>
<tr>
<td>+</td>
<td>Addition</td>
</tr>
<tr>
<td>-</td>
<td>subtraction</td>
</tr>
<tr>
<td>*</td>
<td>multiplication</td>
</tr>
<tr>
<td>/</td>
<td>division</td>
</tr>
<tr>
<td>%</td>
<td>modulus</td>
</tr>
<tr>
<td>++</td>
<td>increment</td>
</tr>
<tr>
<td>--</td>
<td>decrement</td>
</tr>
</th>
</table> <br><br>
<!-- new headings -->
<h3 style="color: red;">Addition operator:</h3> <br>
<h4>The addition operator (+) adds numbers</h4><br><br>
Example: <br>
<xmp>
var x = 5;
var y = 2;
var z = x + y;
</xmp> <br><br>
<!-- new headings -->
<h3 style="color: red;">Subtraction operator:</h3> <br>
<h4>The subtraction operator (-) subtract numbers.</h4><br><br>
Example: <br>
<xmp>
var x = 5;
var y = 2;
var z = x - y;
</xmp> <br><br>
<!-- new headings -->
<h3 style="color: red;">Multiplication operator:</h3> <br>
<h4>The multiplication operator (*) multiplies numbers.</h4><br><br>
Example: <br>
<xmp>
var x = 5;
var y = 2;
var z = x * y;
</xmp> <br><br>
<!-- new headings -->
<h3 style="color: red;">Divide operator:</h3> <br>
<h4>The divide operator (/) divide numbers.</h4><br><br>
Example: <br>
<xmp>
var x = 5;
var y = 2;
var z = x / y;
</xmp> <br><br>
<!-- new headings -->
<h3 style="color: red;">increment operator:</h3> <br>
<h4>The increment operator (++) increment number.</h4><br><br>
Example: <br>
<xmp>
var x = 1;
var y = 7;
var z =++x;
</xmp> <br><br>
<!-- new headings -->
<h3 style="color: red;">decrement operator:</h3> <br>
<h4>The decrement operator (--) decrement number.</h4><br><br>
Example: <br>
<xmp>
var x = 3;
var y = 7;
var z =--x;
</xmp> <br><br>
<h1>JavaScript Assignment Operators</h1> <br><br>
<h4>Assignment operators assign values to JavaScript variables.</h4><br> <br>
<table border="5px" style="margin: 0 auto;color: greenyellow; border: 3px solid red;" >
<th>
<tr>
<td>Opreators</td>
<td>Example</td>
<td>Same As</td>
</tr>
<tr>
<td>=</td>
<td>x=y</td>
<td>x=y</td>
</tr>
<tr>
<td>+=</td>
<td>x+=y</td>
<td>x=x+y</td>
</tr>
<tr>
<td>-=</td>
<td>x-=y</td>
<td>x=x-y</td>
</tr>
<tr>
<td>*=</td>
<td>x*=y</td>
<td>x=x*y</td>
</tr>
<tr>
<td>/=</td>
<td>x/=y</td>
<td>x=x/y</td>
</tr>
<tr>
<td>%=</td>
<td>x%=y</td>
<td>x=x%y</td>
</tr>
</th>
</table> <br><br>
<!-- new headings -->
<h1>Assignment operator(=)</h1> <br><br>
<h4>The assignment operator (=) assigns a value to a variable.</h4><br><br>
Example: <br>
var x=7; <br><br>
<!-- new headings -->
<h1>addition assignment operator (+=)</h1> <br><br>
<h4>The addition assignment operator (+=) adds a value to a variable.</h4><br><br>
Example: <br>
var x = 10;
x += 5; <br><br>
<!-- new headings -->
<h1>Subtraction assignment operator (-=)</h1> <br><br>
<h4>The Subtraction assignment operator (-=) Subtract a value to a variable.</h4><br><br>
Example: <br>
var x = 10;
x -= 5; <br><br>
<!-- new headings -->
<h1>Multplication assignment operator (*=)</h1> <br><br>
<h4>The Multiplication assignment operator (*=) Multiply a value to a variable.</h4><br><br>
Example: <br>
var x = 7;
x *= 2; <br><br>
<!-- new headings -->
<h1>Division assignment operator (/=)</h1> <br><br>
<h4>The Division assignment operator (/=) Divide a value to a variable.</h4><br><br>
Example: <br>
var x = 7;
x /= 6; <br><br>
<!-- new headings -->
<h1>JavaScript String Operators</h1> <br><br>
<h4>The + operator can also be used to add (concatenate) strings.</h4><br> <br>
Example: <br><br>
txt1 = "Sultan";<br>
txt2 = "Muhammad";<br>
txt3 = txt1 + " " + txt2; <br> <br>
The result of txt3 will be: <br><br>
Sultan Muhammad
<br><br>
<!-- new headings -->
<h1>Adding Strings and Numbers</h1> <br><br>
<h4>Adding two numbers, will return the sum, but adding a number and a string will return a string:</h4> <br><br>
Example: <br><br>
x = 2 + 5;<br>
y = "5" + 5;<br>
z = "Sultan" + 5;<br><br>
The result of x, y, and z will be: <br>
7 <br>
55 <br>
Sultan <br> <br>
<!-- new headings -->
<h1>JavaScript Comparison and Logical Operators</h1> <br><br>
<table border="3px" style="margin: 0 auto;color: greenyellow; border: 3px solid red;" >
<th>
<tr>
<td>Operators</td>
<td>Description</td>
</tr>
<tr>
<td>==</td>
<td>equal to</td>
</tr>
<tr>
<td>===</td>
<td>equal value and equal type</td>
</tr>
<tr>
<td>!=</td>
<td>not equal</td>
</tr>
<tr>
<td>!==</td>
<td> Not equal value or not equal type</td>
</tr>
<tr>
<td>></td>
<td>Greater Than</td>
</tr>
<tr>
<td><</td>
<td>Less than</td>
</tr>
<tr>
<td>>=</td>
<td>greater than or equal to</td>
</tr>
<tr>
<td><</td>
<td>Less than or equal to</td>
</tr>
<tr>
<td>?</td>
<td>Ternatry operator</td>
</tr>
</th>
</table>
</div> <br><br>
<!-- new portion -->
<div id="arithmetic">
<h6>8</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3> <br><br>
<h1>JavaScript Arithmetic</h1> <br><br>
<h1>JavaScript Arithmetic Operators</h1> <br> <br>
<h4>Arithmetic operators perform arithmetic on numbers (literals or variables).</h4><br><br>
<table border="3px" style="margin: 0 auto;color: greenyellow; border: 3px solid red;" >
<th>
<tr>
<td>Operator</td>
<td>Description</td>
</tr>
<tr>
<td>+</td>
<td>Addition</td>
</tr>
<tr>
<td>-</td>
<td>Subtraction</td>
</tr>
<tr>
<td>*</td>
<td>Multiplication</td>
</tr>
<tr>
<td>/</td>
<td>Division</td>
</tr>
<tr>
<td>%</td>
<td>Modulus</td>
</tr>
<tr>
<td>++</td>
<td>Increment</td>
</tr>
<tr>
<td>--</td>
<td>Decrement</td>
</tr>
</th>
</table> <br><br>
<!-- new headings -->
<h1>Operators and Operands</h1> <br><br>
<h4>The numbers (in an arithmetic operation) are called operands.
The operation (to be performed between the two operands) is defined by an operator.</h4> <br><br>
<table border="3px" style="margin: 0 auto; color: greenyellow; border: 3px solid red;">
<th>
<tr>
<td>operand</td>
<td>operator</td>
<td>operand</td>
</tr>
<tr>
<td>12</td>
<td>*</td>
<td>14</td>
</tr>
</th>
</table> <br><br>
<!-- new headings -->
<h1>Adding operator</h1> <br><br>
<h4>The addition operator (+) adds numbers:</h4> <br><br>
Example: <br>
var x = 5; <br>
var y = 2;<br>
var z = x + y;<br><br>
<!-- new headings -->
<h1>Subtraction operator</h1> <br><br>
<h4>The subtraction operator (-) subtracts numbers.</h4> <br><br>
Example: <br>
var x = 5; <br>
var y = 2;<br>
var z = x - y;<br>
<!-- new headings -->
<h1>Multiplication operator</h1> <br><br>
<h4>The multiplication operator (*) multiplies numbers.</h4> <br><br>
Example: <br>
var x = 5;<br>
var y = 2;<br>
var z = x * y;<br>
<!-- new headings -->
<h1>Division operator</h1> <br><br>
<h4>The division operator (/) divides numbers.</h4> <br><br>
Example: <br>
var x = 5; <br>
var y = 2;<br>
var z = x / y;<br> <br>
<!-- new headings -->
<h1>Modular operator</h1> <br><br>
<h4>The modular operator (%) returns the division remainder.</h4><br><br>
Example: <br>
var x = 5; <br>
var y = 2;<br>
var z = x % y;<br><br>
<!-- new headings -->
<h1>Increment operator</h1> <br><br>
<h4>The increment operator (++) increments numbers.</h4> <br><br>
Example: <br>
var x = 5; <br>
x++;<br>
var z = x;<br> <br>
<!-- new headings -->
<h1>Decrement operator</h1> <br><br>
<h4>The decrement operator (--) decrements numbers.</h4> <br><br>
Example: <br>
var x = 5; <br>
x--;<br>
var z = x; <br> <br>
</div> <br><br>
<div id="Assignment">
<h6>9</h6>
<h3>Note:please remove the space from closing tag(body) at bottom of examples. </h3> <br><br>
<!-- new headings -->
<h1>JavaScript Assignment Operators</h1> <br><br>
<h4>Assignment operators assign values to JavaScript variables.</h4> <br><br>
<table border="3px" style="margin: 0 auto; color: greenyellow; border: 3px solid red;">
<th>
<th>
<tr>
<td>Operator</td>
<td>Example</td>
<td>Same As</td>
</tr>
</th>
<tr>
<td>=</td>
<td>x=y</td>
<td>x=y</td>
</tr>
<tr>
<td>+=</td>
<td>x+=y</td>
<td>x=x+y</td>
</tr>
<tr>
<td>-=</td>
<td>x-=y </td>
<td>x=x-y </td>
</tr>
<tr>
<td>*=</td>
<td>x*=y</td>
<td>x=x*y</td>
</tr>
<tr>
<td>/=</td>
<td>x/y</td>