Skip to content

Commit 963a220

Browse files
authored
Update script.js
1 parent 7d6a7d7 commit 963a220

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
const heading = document.getElementById("heading");
22
const button = document.getElementById("clickBtn");
33

4-
const originalText = Heading.textContent;
5-
const newText = "Hello World";
4+
const originalText = heading.textContent;
5+
const newText = "Changed Text";
66

77
button.addEventListener("click", () => {
8-
if (Heading.textContent === originalText) {
9-
Heading.textContent = newText;
8+
if (heading.textContent === originalText) {
9+
heading.textContent = newText;
1010
button.textContent = "Click to Revert";
1111
}
1212
else {
13-
Heading.textContent = originalText;
14-
button.textContent = "Click here to Change";
13+
heading.textContent = originalText;
14+
button.textContent = "Click Here to Change";
1515
}
1616
})

0 commit comments

Comments
 (0)