-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjava_script(1).html
55 lines (51 loc) · 1.6 KB
/
java_script(1).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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script>
alert('Hello World');
var i=10;
var j=10;
console.log(i+j);
alert(i+j);
document.write(i+j);
var str='helloworld';
alert(str.substring(3,7));
alert(str.substring(3));
var f=window.prompt("enter the first name:");
var l=window.prompt("enter the last name");
var fl=f+' '+l;
alert(fl);
document.write('<h2>'+fl+'</h2');
var x=window.prompt("enter a number:");
var y=window.prompt("enter a number");
var xy=parseInt(x)+parseInt(y);
alert(xy);
document.write('<h2>'+xy+'</h2');
var a='srt';
var b='sr';
if(a===b){
alert('true type and value');
}
else{
alert('true type');
}
if(a==b){
alert('true value');
}
var names=['sp','np','mp','sjp'];
alert(names[0]);
names[0]='jp';
alert(names);
</script>
</head>
<body>
</body>
</html>