-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.html
More file actions
40 lines (30 loc) · 1.13 KB
/
javascript.html
File metadata and controls
40 lines (30 loc) · 1.13 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
<html>
<head>
<title> Javascript </title>
</head>
<body>
<button onclick="alert('Hi Phoenix!')"> Click here </button>
<p id="text"> Hello Ananya! </p>
<button id="myButton"> Change Text </button>
<p id="secondPara"> Javascript is... </p>
<button id="secondButton"> Append text</button>
<p id="thirdPara"> </p>
<button id="thirdButton"> Click here</button>
<div id="fourthPara"> This is some more text</div>
<button id="fourthButton"> Click Here</button>
<script>
document.getElementById("myButton").onclick = function() {
document.getElementById("secondPara").innerHTML = " Hello Phoenix!";
};
document.getElementById("secondButton").onclick = function(){
document.getElementById("secondPara").innerHTML = "I know that" + document.getElementById("secondPara").innerHTML + "awesome";
};
document.getElementById("thirdButton").onclick = function(){
document.getElementById("thirdPara").innerHTML = "Hello";
};
document.getElementById("fourthButton").onclick = function(){
document.getElementById("fourthPara").style.backgroundColor = "Red";
};
</script>
</body>
</html>