Can someone assist me with creating a button to display answers to questions using input boxes? I have assigned the IDs of the input boxes as the answers themselves, but I am facing issues trying to change the text to match their respective IDs. The current JavaScript code doesn't seem to be working as expected. Any suggestions on how to fix this?
function updateAnswers(){
var inputs = document.getElementsByTagName('input');
for (var i=0; i<inputs.length; i++){
document.getElementById(inputs[i].id).value = inputs[i].id;
}
}