-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.html
More file actions
80 lines (80 loc) · 4.06 KB
/
Copy pathjavascript.html
File metadata and controls
80 lines (80 loc) · 4.06 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
<html>
<head>
<script>
document.write('<h2 style="text-align:center;">What I Understood From Javascript!!</h2>');
document.write("<br>");
document.writeln("Javascipt is a programming language used for both client side and server side which allows us to make our pages more interactive and attractive.We can just make web pages with html and css but it would create only upper appearence and the pages would be non responsive.So,by using javascript we can make pages interactive and user-friendly.And it is also used in creating mobile apps,building web servers,developing games and in many.");
document.write("<br>");
document.write("<br>");
var a=10;var b=50;
console.log(a);
console.log(b);
var array=[1,2,3,4,5];
document.write(array[3].toString());
document.write("<br>");
document.write("Operations On Math Objects!!!");
document.write("<br>");
document.write("Power(2,3):"+Math.pow(2,3));
document.write("<br>");
document.write("sqrt of 64:"+Math.sqrt(64));
document.write("<br>");
document.write("Absolute value of -4.7:"+Math.abs(-4.7));
var r=Math.random();
document.write("<br>");
document.write("random number:"+r);
document.write("<br>");
document.write("round:"+Math.round(r));
document.write("<br>");
document.write("Ceil:"+Math.ceil(r));
document.write("<br>");
document.write("Floor:"+Math.floor(r));
document.write("<br>");
document.write("Trignometric!!");
document.write("<br>");
document.write("Sin(90): "+Math.sin(90 * Math.PI / 180));
document.write("<br>");
document.write("Cos(0):"+Math.cos(0 * Math.PI / 180));
document.write("<br>");
document.write("<br>");
var d=new Date();
console.log("Date:"+d);
document.write("<br>");
document.write("Usage of Loops:");
var p=Math.floor(Math.random()*101);
document.write("<br>");
try{if(p>10 && p<101)
{
document.write("random number created:"+p);
document.write("<br>");
document.write("Fibonnaci of"+"\n"+p+"\n"+"is:");
var t=0;var t1=1;
document.write(t+"\n"+t1);
for(var i=2;i<p;i++)
{
var c=t+t1;
t=t1;
t1=c;
document.write("\n"+t1);
}}
else
document.write("create another random number by refreshing the page");}
catch(err)
{
document.write("Give correct value");
}
document.write("<br>");
document.write("<br>");
document.write("Finding 5th,7th,10th words from html description !! : HTML stands for Hyper Text Markup Language.HTML is the standard markup language for creating Web pages.HTML describes the structure of a Web page.HTML consists of a series of elements.HTML elements tell the browser how to display the content.HTML elements label pieces of content such as this is a heading, this is a paragraph, this is a link, etc.");
var str="HTML stands for Hyper Text Markup Language.HTML is the standard markup language for creating Web pages.HTML describes the structure of a Web page.HTML consists of a series of elements.HTML elements tell the browser how to display the content.HTML elements label pieces of content such as this is a heading, this is a paragraph, this is a link, etc.";
var res=str.slice(22,26);
var res1=str.slice(33,42);
var res2=str.slice(51,54);
document.write("<br>");
document.write("5th term:"+res);
document.write("<br>");
document.write("7th term:"+res1);
document.write("<br>");
document.write("10th term:"+res2);
</script>
</head>
</html>