首页javascriptradiobuttonjQuery Form - 如何将单选按钮值设置为true

jQuery Form - 如何将单选按钮值设置为true

我们想知道如何将单选按钮值设置为true。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.6.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $radio = $('#radio2');
    $radio.get(0).checked = true;
});
</script>
</head>
<body>
  <input id="radio1" type="radio" name="mybtn" value="0" />0
  <br />
  <input id="radio2" type="radio" name="mybtn" value="1" />1
</body>
</html>