+ 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
6 Antworten
+ 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?