-
Notifications
You must be signed in to change notification settings - Fork 0
/
d2.html
56 lines (52 loc) · 1.55 KB
/
d2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="doc"></div>
<script>
/*console.log("a");
let a=prompt("Write a no.");
a=Number.parseInt(a);
while(a!=0)
{
console.log("Try again");
a=prompt("Write a nno.");
a=Number.parseInt(a);
}*/
//jason.stringify()
/*let a=10,b=20;
function add(a,b){
let c = a+b;
return c;
}
console.log(add(a,b));
let x=10,y=20;
function sub(x,y){
let s = x-y;
return s;
}
console.log(sub(x,y));
let w=[1,2,3];
console.log(typeof(w));
console.log(w.toString);*/
//unshift adds before 1st element
//window.document.getElementById("doc").innerHTML="Hello world";
//document.getElementById("doc").style.color="#69ff69";
let a=document.getElementsByClassName("raj")[0].style.color="red";
console.log(a);
//console.log(document.body.firstElementChild.nextElementSibling.nextElementSibling.nextElementSibling);
a=document.body.getElementsByTagName("div")[0];
console.log(a)
let b=document.createElement('span')
b.innerHTML="Welcome to arena batch 2023";
a.appendChild(b);
raj.insertAdjacentHTML("beforeend", "<span>I like You</span>");
raj.className=("red");
raj.classList.add('yellow');
</script>
</body>
</html>