<script language=javascript>
var srcc = window.location;
srcc = srcc.tostring()
start = srcc.indexof("?");
end = srcc.length;
</script>
<script>
alert(location.search); //这个不是比你的更为简洁了吗?
</script>
</script>
<input type=checkbox name=mm value=a onclick="item(this, 'mmall')"><br>
<input type=checkbox name=mm value=b onclick="item(this, 'mmall')"><br>
<input type=checkbox name=mm value=c onclick="item(this, 'mmall')"><br>
<input type=checkbox name=mm value=d onclick="item(this, 'mmall')"><br>
<input type=checkbox name=mm value=e onclick="item(this, 'mmall')"><br><br>
<input type=checkbox name=mmall onclick="all(this, 'mm')">全选与不全选的切换
<script language=javascript>
function all(e, itemname)
{
var aa = document.getelementsbyname(itemname);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked; //得到那个总控的复选框的选中状态
}
function item(e, allname)
{
var all = document.getelementsbyname(allname)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getelementsbyname(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
}
</script>