+ 2
Once I put questions in a form as well as a submit button, how to I alert users that they are correct or incorrect?
I am creating a quiz but I am not sure how to tell the person they are correct or incorrect. How do I do this? https://code.sololearn.com/WLt0eiCehzpp/?ref=app
7 RĂ©ponses
+ 1
Kaenen a working sample of your program
In html part, whenever you click on radio the value is sent to setval() function.
When submit button is pressed, JavaScript part checks if the selected radio button is equal to answer and shows corresponding alert message
https://code.sololearn.com/W9iOtjymz2FK/?ref=app
+ 4
Add:
HTML:
<form>
some code...
<input type="submit" onclick="func()" />
</form>
JS:
function func() {
// if statement
alert("some text...");
//else if statement
alert("some text...");
//else
alert("some text...");
}
+ 3
Please link your code
+ 3
â âââSreejith thank you! i get it now!
+ 2
â âââSreejith Guezi Louay i linked it :)
+ 2
đČđ°Maksi - VikđČđ° for the if statements, what do i put to make it the correct answer, which is 42?