<FORM METHOD=POST ACTION="">
<input type=radio id=rdo1 checked>
<input type=radio id=rdo2>
<Input type=checkbox id=chk1>
<input type=checkbox id=chk2 checked>
</FORM><SCRIPT LANGUAGE="JavaScript">
<!--
var el = document.forms[0].elements;
var count = el.length;
for (i=0;i<count;i++)
{
if (el[i].type=="radio")
{
if (el[i].checked==true)
{
alert('被选中的是:'+el[i].id);
}
}
if (el[i].type=="checkbox")
{
if (el[i].checked==true)
{
alert('被选中的是:'+el[i].id);
}
}
}
//-->
</SCRIPT>