Reputation: 323
Got a quiz app here, I'm wondering how I can rewrite this conditional without the $.
if ($('input[name="radioOption"]:checked').length < 1) {
alert('Please Make a Selection');
}
Here is a fiddle to all the code:: https://jsfiddle.net/scrippyfingers/z84pc45t/
Upvotes: 0
Views: 68
Reputation: 292
if(!document.querySelector("input[name='radioOption']:checked")) {
That should work for you.
Upvotes: 5