1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)

JavaScript Simple True or False Script

Here is a little JavaScript true or false script that you can have some fun with. You can even develop further intricate programs off of this little script here. Enjoy!

<html>
<head>
<title>Quiz</title>
</head>
<body>
<h1>Quiz</h1>
<div id="question">True or False: The sky is blue?</div>
<button onclick="truee()">True</button>
<button onclick="falsee()">False</button>
<script>
function truee(){
document.getElementById('question').innerHTML="That is correct";
document.getElementById('question').style.color="green";
document.getElementById('question').style.textTransform="uppercase";
}

function falsee(){
document.getElementById('question').innerHTML="That is not correct";
document.getElementById('question').style.color="red";
document.getElementById('question').style.textTransform="uppercase";
}
</script>
</body>
</html>
JavaScript Simple True or False Script was last modified: May 20th, 2017 by Maximus Mccullough

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share:
How to Use JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.