<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<input type="radio" name="radio12" id="radio1">
<input type="radio" name="radio12" id="radio2">
<button type="button" id="btn1">asd</button>
<script type="text/javascript">
$('#btn1').on('click',
function() {
if($('input[id=radio1]:checked')){
window.location.replace('https://www.naver.com/');
console.log("라디오1");
}
else if($('input[id=radio2]:checked')){
window.location.replace('https://www.yahoo.com/');
console.log("라디오2");
}
else {
console.log("recontext");
}
}
);
</script>
</body>
</html>
첫번째를 체크하고 버튼을 눌렀을경우 네이버로 가는데 두번째 체크하고 버튼을 눌르면 네이버로 가는데 해결법을 몰르겠습니다. ㅠㅠ