I made an If/Else statement that would tell if 10 equaled 5 and it would give the answer. I was wondering if i could make a reset to reset the answer given.
heres my code
heres my code
Code:
html
<!DOCTYPE html> <html> <body> </form>
<p>Click the button:</p>
<button onclick="myFunction()">Try it</button> <p id="demo"></p>
JS
function myFunction() {
var greeting;
if (10 == 10){
greeting = "Yes";
} else {
greeting = "No";
}
document.getElementById("demo").innerHTML = greeting;
}
Comment