<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("blue").defaultChecked;
alert(x);
}
</script>
</head>
<body>
<form>
What color do you prefer?<br>
<input type="radio" name="colors" id="red">Red<br>
<input type="radio" name="colors" id="blue" checked>Blue<br>
<input type="radio" name="colors" id="green">Green
</form>
<button type="button" onclick="displayResult()">Is "Blue" checked by default?</button>
</body>
</html>