The text field and button are both centered horizontally on the page, but I cannot figure out how to center the "You are correct!" and "Try again!"
I feel like I have tried everything, but obviously I haven't, considering I can't get it to work.
<center><p>Can you remember how many books I listed at the bottom of the page?</p></center>
<center><button type="button" onclick="myFunction()">Submit</button></center>
var x, text;
// Get the value of the input field with id="numb"
x = document.getElementById("numb").value;
// If x is Not a Number or less than five or greater than five
if (isNaN(x) || x < 5 || x > 5)
text = "Try again!";
text = "You are correct!";
document.getElementById("demo").innerHTML = text;
Here is the CSS code for the function:
This specific CSS code is only one of many, many attempts I have made at centering the text in the function.
Here is a link to a picture that will show you the problem I am having: