-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
116 lines (116 loc) · 5.93 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main id="main-doc">
<div>
<nav id="navbar">
<header>naviagtions</header>
<ul>
<li><a href="#JavaScript" class="nav-link">JavaScript</a></li>
<li><a href="#Js_Introduction" class="nav-link">Js Introduction</a></li>
<li><a href="#Js_Where_Do" class="nav-link">Js Where Do</a></li>
<li><a href="#JavaScript_Object_Definition" class="nav-link">JavaScript Object Definition</a></li>
<li><a href="#JavaScript_Classes" class="nav-link">JavaScript Classes</a></li>
<li><a href="#" >Syntax</a></li>
<li><a href="#">Comments</a></li>
<li><a href="#">variables</a></li>
<li><a href="#">Let</a></li>
<li><a href="#">Const</a></li>
<li><a href="#">Operator</a></li>
</ul>
</section>
</nav>
</div>
<div>
<section class="main-section" id="JavaScript">
<header id="JavaScript">JavaScript</header>
<li class="li">javas function</li>
<li class="li">javas class</li>
<code>
<p class="para">JavaScript is a programming language used to create dynamic content for websites. It achieves this by adding new HTML elements while modifying existing ones.?</p>
<p class="para">JavaScript syntax is the set of rules, how JavaScript programs are constructed:</p>
<p class="para">How to create variables:</p>
</code>
var x;<br/>
let y;<br/>
<p class="para">How to use variables:</p>
x = 5;<br/>
y = 6;<br/>
let z = x + y;
</section>
<br/>
<section class="main-section" id="Js_Introduction">
<header id="Js_Introduction">Js Introduction</header>
<li class="li">How do I get JavaScript?</li>
<li class="li">Where can I download JavaScript?</li>
<code>
<p class="para"> JavaScript is an open-source programming language designed for creating web-centric applications. It is lightweight and interpreted which makes it much faster than other languages and is integrated with HTML making it easier to implement in web applications.
In this Introduction to JavaScript article, you will learn all about JavaScript, the backbone of web development, and understand what exactly this language is and why and how this language is used across various fields.
JavaScript is critical for web development, and if you’ve ever thought about choosing that career path, you’d surely have come across this language. And probably, that’s why you are here in the first place.
</p>
</code>
</section>
<section class="main-section" id="Js_Where_Do">
<header id="Js_Where_Do">Js Where Do</header>
<li class="li">Writing into an HTML element, using innerHTML.</li>
<li class="li">Writing into the HTML output using document.write().</li>
<code>
<p class="para">JavaScript Output Methods and Properties There are a total of six ways to display text and/or content with JavaScript, depending on where you want to write it to; the first three are properties, while the other three are methods: The innerHTML, innerText and textContent properties written into an HTML element. The document.write() method writes directly into the HTML output.
The window.alert() method displays an alert box, suitable for displaying error messages and the like.
The console.log() method writes to the browser console, making it ideal for displaying debugging information.
The rest of this programming tutorial will delve into each of these methods and properties.</p>
</code>
</section>
<section class="main-section" id="JavaScript_Object_Definition">
<header id="JavaScript_Object_Definition">JavaScript Object Definition</header>
<li class="li">Writing into an alert box, using window.alert().</li>
<li class="li">Writing into the browser console, using console.log().</li>
<code>
<p class="para">Methods for Defining JavaScript Objects
Using an Object Literal
Using the new Keyword
Using an Object Constructor
Using Object.assign()
Using Object.create()
Using Object.fromEnties()
JavaScript Object Litera
An object literal is a list of property names:values inside curly braces {}.
{firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};</p>
</code>
<p class="para">Note:
An object literal is also callled an object initializer.</p>
</section>
<section class="main-section" id="JavaScript_Classes">
<header id="JavaScript_Classes">JavaScript Classes</header>
<li class="li">Writing into an alert box, using window.alert().</li>
<li class="li">Writing into the browser console, using console.log().</li>
<code>
<p class="para">ECMAScript 2015, also known as ES6, introduced JavaScript Classes.
JavaScript Classes are templates for JavaScript Objects.
JavaScript Class Syntax
Use the keyword class to create a class.
Always add a method named constructor():
Syntax</p>
</code>
<p class="para"> class ClassName {
constructor() { ... }
}
Example
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
}
</p>
</section>
</div>
</main>
</body>
</html>