标签: javascript jquery html
在这里有一个测验应用程序,我想知道如何在没有$的情况下重写这个条件。
if ($('input[name="radioOption"]:checked').length < 1) { alert('Please Make a Selection'); }
这是所有代码:: https://jsfiddle.net/scrippyfingers/z84pc45t/
答案 0 :(得分:5)
if(!document.querySelector("input[name='radioOption']:checked")) {
这对你有用。