jQuery checking and getting radio input | SoloLearn: Learn to code for FREE!

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

4/8/2018 3:17:13 PM

cyk

2 Answers

New Answer

+4

to check if a check box is checked:: if($("input").is("::checked")) {}

0

Thanks 🇳🇬Brains