<!DOCTYPE html>

<html>

<body>


<form>


  <input type="radio" name="colors" id="red">Red<br>

  <input type="radio" name="colors" id="blue">Blue

</form>


<button onclick="check()">Check "Red"</button>



<script>


function check() {

  if(document.getElementById("red").checked==true){

alert("d");

 }

}

</script>


</body>

</html>



블로그 이미지

왕왕왕왕

,