-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Antara-Paul04/Antara
feat: Added Tracks
- Loading branch information
Showing
3 changed files
with
348 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Tracks js | ||
document.addEventListener("DOMContentLoaded", function () { | ||
const bodyText = document.querySelector(".body-text"); | ||
|
||
function updateBodyText(track) { | ||
switch (track) { | ||
case "track1": | ||
bodyText.innerHTML = "<h5>Body text for Track 1</h5>"; | ||
break; | ||
case "track2": | ||
bodyText.innerHTML = "<h5>Body text for Track 2</h5>"; | ||
break; | ||
case "track3": | ||
bodyText.innerHTML = "<h5>Body text for Track 3</h5>"; | ||
break; | ||
default: | ||
bodyText.innerHTML = "<h5>Lorem ipsum dolor sit amet</h5>"; | ||
} | ||
} | ||
|
||
const dropdown1 = document.querySelector(".button1"); | ||
const dropdown2 = document.querySelector(".button2"); | ||
const dropdown3 = document.querySelector(".button3"); | ||
|
||
dropdown1.addEventListener("click", function () { | ||
updateBodyText("track1"); | ||
}); | ||
|
||
dropdown2.addEventListener("click", function () { | ||
updateBodyText("track2"); | ||
}); | ||
|
||
dropdown3.addEventListener("click", function () { | ||
updateBodyText("track3"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters