Сообщение от EdemKakMozhem
|
проблема в неверном цикле
|
Судя по задаче цикл там не нужен...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!--
<script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
-->
<style>
</style>
<script>
document.addEventListener('DOMContentLoaded', _ => {
const o = document.querySelector('.form')
o.addEventListener('click', e => test())
function test() {
o.querySelector('.btn-next').disabled = !o.querySelector(':checked')
}
test()
})
</script>
</head>
<body>
<form class="form">
<input class="radio" id="block-11m" type="radio" name="radio" value="level-2">
<label for="block-11m">одноэтажный</label>
<input class="radio" id="block-12m" type="radio" name="radio" value="leveд-1">
<label for="block-12m">двухэтажный</label>
<input class="radio" id="block-13m" type="radio" name="radio" value="level-3">
<label for="block-13m">трехэтажный</label>
<button class="btn-next" name="submit" type="submit">ДАЛЕЕ</button>
</form>
</body>
</html>