js显示隐藏div块

<div id="text"></div>

<input type="button" onclick="display('text')" />
function $_(id){
return document.getElementById(id);
};
function display(x){
$(x).style.display=($(x).style.display=="none")?"":"none";
};



posted @ 2012-02-08 18:36  Joerias  阅读(1795)  评论(0编辑  收藏  举报