-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
230 lines (174 loc) · 5.05 KB
/
Copy pathscript.js
File metadata and controls
230 lines (174 loc) · 5.05 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
// for comment from keyboard (ctrl+ /)
// document.writeln("hi from javascript external");
var name1=5;
var Name="ahmed";
var $name=45;
var sum = $name+name1;
// document.writeln(sum);
function myclick() {
alert("new alert");
}
// === this qual for type and value
// == this qual for value only
if (1=="1" & 2 === "2" ) {
document.write("equal 1");
} else if (1==="1" | 2 === "2") {
document.write("equal 2");
}else if (1===1)
{
document.write("equal 3");
}
else
{
document.write("not equal");
}
var today="sunday";
var result;
switch (today) {
case "sunday":
result="sunday"
break;
case "monday" :
result ="monday"
default:
break;
}
document.write(result);
for (let i = 0; i<10 ; i++) {
document.write( i+" - "+"ahmed jamal <br>");
}
var x= 10
while (x<=20) {
document.write( x +"<br>");
x++;
}
do {
document.write( x +"<br>");
x++;
} while (x<=20);
function age(num1) {
alert("my age is " + num1);
}
person={
names:"ahmed",
age:20,
lastname:"midoo"
}
document.write(person.names + " " + "age = "+ person.age);
document.write("<br>");
function myemployee(id,name,lname,age) {
this.id=id;
this.name=name;
this.lname=lname;
this.age=age;
}
emp=new myemployee(1,"ahmed","jamal",26);
document.write(emp.name+ " "+emp.lname + " "+emp.age);
document.write("<br>");
document.write("<br>");
var myname = ["ahmed","essa","hamed"];
for (let index = 0; index < myname.length; index++) {
const element = myname[index];
document.write(element + "<br>");
}
document.write("<br>");
document.write("<br>");
var num11=22;
var num22=2.4112244;
var num33=25e3;
//var num44= new number(14);
num55=num22.toFixed(2);
num77=num22.toPrecision(3);
num88=num22.toExponential(1);
num66=num11.toString();
document.write( num11);
document.write( num22+"<br>");
document.write( num33+"<br>");
document.write( num55+"<br>");
document.write( num66+"<br>");
document.write( num77+"<br>");
document.write( num88+"<br>");
document.write( typeof(num88)+"<br>");
//document.write( num44+"<br>");
document.write("<br>");
document.write("<br>");
var myname =" ahmed jamal jamal";
var lname = new String ("jamal");
document.write(myname.charAt(3) + "<br>");
document.write(lname.charAt(2) + "<br>");
document.write(myname.concat(lname) + "<br>");
document.write(lname.indexOf("al") + "<br>");
document.write(lname.lastIndexOf("ja") + "<br>");
document.write(lname.toUpperCase() + "<br>");
document.write(lname.toLowerCase() + "<br>");
document.write(lname.slice(1,3) + "<br>");
document.write(myname.trim() + "<br>");
document.write("<br>");
document.write("<br>");
var num122 = 4;
var num52= Math.sqrt(num122);
var numMath = Math.random(4);
var numPow = Math.pow(2,4);
var numFloor = Math.floor(2.7);
var numCeil = Math.ceil(2.9);
document.write(num22 + "<br>");
document.write(numMath + "<br>");
document.write(numPow + "<br>");
document.write(numFloor + "<br>");
document.write(numCeil + "<br>");
document.write("<br>");
document.write("<br>");
document.write(1<2);
document.write("<br>");
document.write(22<1);
document.write("<br>");
document.write("<br>");
var mydate = new Date();
var myDay= mydate.getDate();
var myMonth= mydate.getMonth();
var myYear= mydate.getFullYear();
var myHours = mydate.getHours();
document.write(mydate + "<br>");
document.write(myMonth+1 + "<br>");
document.write(myYear + "<br>");
document.write(myHours + "<br>");
document.write("<br>");
document.write("<br>");
function fname() {
// window.history.back();
// window.history.forward();
document.write("<br>" + " appCodeName - "+ window.navigator.appCodeName);
document.write("<br>" + " appName - "+ window.navigator.appName);
document.write("<br>" + " cookieEnabled - "+ window.navigator.cookieEnabled);
document.write("<br>" + " language - "+ window.navigator.language);
document.write("<br>" + " platform - "+ window.navigator.platform);
document.write("<br>" + " platform - "+ window.navigator.platform);
}
fname();
document.write("<br>");
document.write("<br>");
function fscreen() {
document.write("<br>" + " width - "+ window.screen.width);
document.write("<br>" + " height - "+ window.screen.height);
document.write("<br>" + " colorDepth - "+ window.screen.colorDepth);
document.write("<br>" + " pixelDepth - "+ window.screen.pixelDepth);
document.write("<br>" + " availHeight - "+ window.screen.availHeight);
document.write("<br>" + " availWidth - "+ window.screen.availWidth);
}
fscreen();
document.write("<br>");
document.write("<br>");
document.getElementById("addelm").innerHTML("ahmed jamal");
function name12() {
document.getElementById("inpelme").value = "ahmed jamal";
}
document.write("<br>");
document.write("<br>");
var nname = document.getElementByTagName("INPUT")[0].value;
document.getElementById("addelmm").innerHTML=nname;
document.write("<br>");
document.write("<br>");
function CreateForm() {
var myform = ' <input type="text"><input type="text"><input type="time"><button></button>'
document.getElementById("created").innerHTML=myform;
}