-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
77 lines (62 loc) · 1.73 KB
/
main.js
File metadata and controls
77 lines (62 loc) · 1.73 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
// Assignment 1
/*
The first code will not work
because it was called before
loading the page elements,
and therefore it does not
know what the element with id "e" is.
*/
// Assignment 2
document.write("<h1>Elzero</h1>");
// Method 1
document.querySelector("h1").style.color = "blue";
document.querySelector("h1").style.fontSize = "80px";
document.querySelector("h1").style.fontWeight = "bold";
document.querySelector("h1").style.textAlign = "center";
document.querySelector("h1").style.fontFamily = "Arial";
// Method 2
document.querySelector("h1").style =
"color: blue; font-size: 80px; font-weight: bold; text-align: center; font-family: Arial";
// Method 3
document.querySelector("h1").style = `
color: blue;
font-size: 80px;
font-weight: bold;
text-align: center;
font-family: Arial
`;
// Assignment 3
console.log(
"%cElzero %cWeb %cSchool",
"color: red; font-size: 40px",
"color: green; font-size: 40px; font-weight: bold",
"background-color: blue; font-size: 40px"
);
// Assignment 4
console.group("Group 1");
console.log("Message One");
console.log("Message Two");
console.group("Child Group");
console.log("Message One");
console.log("Message Two");
console.group("Grand Child Group");
console.log("Message One");
console.log("Message Two");
console.groupEnd();
console.groupEnd();
console.groupEnd();
console.group("Group 2");
console.log("Message One");
console.log("Message Two");
console.groupEnd();
// Assignment 5
console.table(["Elzero", "Ahmed", "Sameh", "Gamal", "Aya"]);
// Assignment 6
// Method 1
// console.log("Iam In Console");
// document.write("Iam In Page");
// Method 2
/*
console.log("Iam In Console");
document.write("Iam In Page");
*/