Выдает ошибку - script.js:3 Uncaught TypeError: Cannot read property 'checked' of null.Спасибо профи.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Вероятность СOVID 19</title>
</head>
<body>
<form>
<p><b>Возраст.</b></p>
<input id="v1"/><p></p>
<p><b>Пол</b></p>
<p><input name="dzen" type="radio" value="nedzen1">М</p>
<p><input name="dzen" type="radio" value="nedzen2">Ж</p>
</form>
<p><b>Хроническое заболевание сердца</b></p>
<form>
<p><input name="dzen" type="radio" value="nedzen3">Да</p>
<p><input name="dzen" type="radio" value="nedzen4" checked>Нет</p>
</form>
<form>
<p><b>Хроническое заболевание почек</b></p>
<p><input name="dzen" type="radio" value="nedzen5">Да</p>
<p><input name="dzen" type="radio" value="nedzen6" checked>Нет</p>
</form>
<form>
<p><b>Сахарный диабет</b></p>
<p><input name="dzen" type="radio" value="nedzen7">Да</p>
<p><input name="dzen" type="radio" value="nedzen8" checked>Нет</p>
</form>
<form>
<p><b>Деменция</b></p>
<p><input name="dzen" type="radio" value="nedzen9">Да</p>
<p><input name="dzen" type="radio" value="nedzen10" checked>Нет</p>
</form>
<form>
<p><b>Гипертензия</b></p>
<p><input name="dzen" type="radio" value="nedzen11">Да</p>
<p><input name="dzen" type="radio" value="nedzen12" checked>Нет</p>
</form>
<button onclick="cop()">Расчитать вероятность COVID 19</button>
<p id="resultat"></p>
<script>function cop() {
const v1 = document.getElementById("v1").value;
if(document.getElementById('nedzen1').checked == true){
const p1 = 1;
};
if(document.getElementById('nedzen2').checked == true){
const p1 = 0;
};
if(document.getElementById('nedzen3').checked == true){
const p2 = 1;
};
if(document.getElementById('nedzen4').checked == true){
const p2 = 0;
};
if(document.getElementById('nedzen5').checked == true){
const p3 = 1;
};
if(document.getElementById('nedzen6').checked == true){
const p3 = 0;
};
if(document.getElementById('nedzen7').checked == true){
const p4 = 1;
};
if(document.getElementById('nedzen8').checked == true){
const p4 = 0;
};
if(document.getElementById('nedzen9').checked == true){
const p5 = 1;
};
if(document.getElementById('nedzen10').checked == true){
const p5 = 0;
};
if(document.getElementById('nedzen11').checked == true){
const p6 = 1;
};
if(document.getElementById('nedzen12').checked == true){
const p6 = 0;
};
const X1 = 6.903 + 0.047 * v1;
const X2 = 0.553 * pol1;
const X3 = 0.614 * pol2;
const X4 = 0.536 * pol6;
const X5 = 1.149 * pol3;
const X6 = 0.734 * pol4;
const X7 = 1.03 * pol5;
const X = X1 + X2 + X3 + X4 + X5 + X6 + X7;
const S = 1+Math.exp(-X);
const Y = 1/(1+S);
if (Y > 0.044) {
const rez = "Прогноз : смерть.";
}else{
const rez = "Прогноз : жизнь.";
};
document.getElementById("resultat").innerHTML = rez;
};</script>
</body>
</html>