Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
siroshimadenagasaki committed Oct 15, 2024
1 parent 9e7f7ee commit e45f9e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3822,24 +3822,24 @@
</script>


<button type="button" class="switch-to-instrument" onclick="switchInstrument(event, this)">Switch to Piano</button>
<button type="button" class="switch-to-instrument" onclick="switchInstrument(event, this)">Switch to Guitar</button>

<script>
// Initially, guitar view hidden hoga
document.querySelector(".show-piaono").style.display = "none";
document.querySelector(".show-guitar").style.display = "none";

function switchInstrument(event, button) {
event.preventDefault(); // Prevent any default behavior (important in case of form)

// Button ka text toggle karna
if (button.innerHTML === "Switch to Piano") {
button.innerHTML = "Switch to Guitar";
document.querySelector(".show-piaono").style.display = "block"; // Show Piano
document.querySelector(".show-guitar").style.display = "none"; // Hide Guitar
} else {
if (button.innerHTML === "Switch to Guitar") {
button.innerHTML = "Switch to Piano";
document.querySelector(".show-guitar").style.display = "block"; // Show Guitar
document.querySelector(".show-piaono").style.display = "none"; // Hide Piano
document.querySelector(".show-piaono").style.display = "none"; // Show Piano
document.querySelector(".show-guitar").style.display = "block"; // Hide Guitar
} else {
button.innerHTML = "Switch to Guitar";
document.querySelector(".show-guitar").style.display = "none"; // Show Guitar
document.querySelector(".show-piaono").style.display = "block"; // Hide Piano
}
}
</script>
Expand Down
Binary file added trash/.DS_Store
Binary file not shown.

0 comments on commit e45f9e0

Please sign in to comment.