JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
</body>
</html>
JavaScript
let keepPlaying = function(){
background = Math.floor(Math.random()).toString();
document.body.innerHTML = background;
var answer = prompt("What pokemon is this?")
if (answer.toLowerCase() == background) {
alert("correct")
score ++
replay = prompt("Want to keep playing?")
} else {
alert("incorrect")
replay = prompt("Want to keep playing?")
}
if(replay == 'yes')
keepPlaying()
else
return(score)
}();