var Element =
{
toggle:function(eleID)
{
var element = $(eleID);
var dis = element.style.display;
element.style.display = dis=="none"?"block":"none"
}
};
<div id="divid">看的到我么</div>
//Element.toggle("divid");
{
toggle:function(eleID)
{
var element = $(eleID);
var dis = element.style.display;
element.style.display = dis=="none"?"block":"none"
}
};
<div id="divid">看的到我么</div>
//Element.toggle("divid");
2.
String.prototype.diss = function()
{
var element = document.getElementById(this);
var dis = element.style.display;
element.style.display = dis=="none"?"block":"none";
}
<div id="divid">看的到我么</div>
//"divid".diss();
{
var element = document.getElementById(this);
var dis = element.style.display;
element.style.display = dis=="none"?"block":"none";
}
<div id="divid">看的到我么</div>
//"divid".diss();