<
script
src
=
"jquery.js"
></
script
>
<
script
>
$(function(){
//选中单选或复选框
var checked = true;
if(true = checked){
$("#r1").attr({
checked:"checked"
});
$("#c1").attr({
checked:"checked"
});
}
//取消以选中的单选或复选框
if(false = checked){
$("#r1").removeAttr("checked");
$("#c1").removeAttr("checked");
}
});
</
script
>
<
input
id
=
"r1"
type
=
"radio"
value
=
"1"
>
<
input
id
=
"c1"
type
=
"checkbox"
value
=
"1"
>