I am working on a simple code to help guess notes by ear. The concept involves tabs with empty input fields where numbers need to be entered based on a specific melody for the guitar fretboard. One button reveals the first note, while another button checks if the correct number has been entered and either approves or erases it accordingly.
I have been able to check each input field using its id, but I am wondering if there is a way to retrieve the value from the selected input when the second button is pressed and compare it to the placeholder or value attribute?
If you would like to view my progress, here is the link to my Codepen page: https://codepen.io/fukenist/pen/BxJRwW Here is the script part:
function showfirst() {
document.getElementById("fst").value = "12"
}
function show1other() {
var snote = document.getElementById("scnd").value;
if (snote == 9 ){
document.getElementById("scnd").value = "9";
}
else {
document.getElementById("scnd").value = "";
}
}