JavaScript

Posted on

<html>

<head><title></title>

<script>

function checkAnswers()

{

var myQuiz=document.getElementById(“myquiz”);

if(myQuiz.elements[1].checked)

alert(“Congratulation,your answer is correct”);

else

alert(“Your answer is incorrect, please try again”);

}

</script>

</head>

<body>

<form id=”myquiz”  action=”onlinequiz.html”>

<p>Select the name of the tip that goes with the image shown<br/>

<img src=”” alt=””>

<input type=”radio” name=”radiobutton” value=”CPE”/>

<label> Common Programming Error</label>

<input type=”radio” name=”radiobutton” value=”EPT”/>

<label> Error Prevention Tip</label>

<input type=”radio” name=”radiobutton” value=”PERF”/>

<label> Performance Tip</label>

<input type=”radio” name=”radiobutton” value=”PORT”/>

<label> Protability Tip</label><br/>

<input type=”button” name=”submit” value=”submit” onClick=”checkAnswers()”/>

<Input type=”reset” name=”reset” value=”Reset”/>

</p>

</form>

</body>

</html>

6

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s