I made a button but when I press the button I want to change the button to just a text output. I don't want to change the text inside the button. I want to change the button itself into a text.
<input type="button" id="button1" value="See Answer" onclick="check1();">
this is my button.
<script type="text/javascript">
function check1() {
const answer = document.getElementById("question1").innerText;
const mybutton = document.getElementById("button1");
if(answer=="Seoul") mybutton.innerText = "CORRECT"
else mybutton.innerText = "Seoul"
}
</script>
this is my unfinished version of changing the button into the text "CORRECT" if the answer is correct and changing the button into text "Seoul" if the answer is wrong.
innerTextwithvalue, it will works