jQuery checking and getting radio input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

jQuery checking and getting radio input

I attached part of the code below. So, how can I, with jQuery: * check if one of the options is selected * do differetnt things based on which one is selected. Say, alert Spam if yes and Eggs if no * and do I absolutely need to add a submit button? The answers I found online have only confused me. https://code.sololearn.com/W8OXr5E22jFj/?ref=app

8th Apr 2018, 3:17 PM
cyk
cyk - avatar
2 Answers
+ 4
to check if a check box is checked:: if($("input").is("::checked")) {}
8th Apr 2018, 4:08 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
9th Apr 2018, 9:12 AM
cyk
cyk - avatar