日期:2014-05-16  浏览次数:20301 次

请教高手怎么样传递补ID给当前层,在线等
请教高手怎么样传递补ID给当前层,从而达到click隐藏、显示的效果
function   showGrp(id)   {
    var   id=id;
    document.getElementById(diva_id).className   =   'hideGrp ';
    document.getElementById(divb_id).className   =   'showGrp ';
    document.getElementById(divc_id).className   =   'showGrp ';
}
也就是要diva_,divb_,divc_后的id为传递过来的变量值,谢谢,在线等.
onclick   =   showGrp(id);

------解决方案--------------------
document.getElementById( "diva_ "+id).className = 'hideGrp ';
------解决方案--------------------
showGrp()调用的时候必须是数字showGrp(2)
如果是字符需要showGrp( "M1 ")