I have the following code:
function disabler(){
var content = document.getElementById("show").textContent;
var correct = "Roll Number Correct";
var incorrect = "Roll Number Incorrect";
alert(content == correct);
/* if (){
alert(content);
} */
}
I have checked the value of the content variable ( which is as same as the correct variable)and used the typeof operator to be sure of its type. To my knowledge, the alert should yield true but it is not. What could be the possible solutions?
contentiscorrect? There could be extra whitespace or something.console.log(content);and post outputdocument.getElementById("show").textContent.trim()