javascript $
<script>
var $=function(objId){
this.obj = document.getElementById(objId);
};
$.prototype.hide = function(){this.obj.style.display = "none";};
$.prototype.show = function(){this.obj.style.display = "";};
$.prototype.toggle = function(){this.obj.style.display = (this.obj.style.display=="none"?"":"none");};
$.prototype.get = function(type){
if(type=="value"){return this.obj.value=str;}
if(type=="innerHTML"){return this.obj.innerHTML=str;}
if(type=="checked"){return this.obj.checked=str;}
};
$.prototype.set = function(type,str){
if(type=="value"){this.obj.value=str; return;}
if(type=="innerHTML"){this.obj.innerHTML=str; return;}
if(type=="checked"){this.obj.checked=str; return;}
};
$.prototype.add = function(type,str){
if(type=="value"){this.obj.value+=str; return;}
if(type=="innerHTML"){this.obj.innerHTML+=str; return;}
if(type=="checked"){this.obj.checked+=str; return;}
};
</script>
var $=function(objId){
this.obj = document.getElementById(objId);
};
$.prototype.hide = function(){this.obj.style.display = "none";};
$.prototype.show = function(){this.obj.style.display = "";};
$.prototype.toggle = function(){this.obj.style.display = (this.obj.style.display=="none"?"":"none");};
$.prototype.get = function(type){
if(type=="value"){return this.obj.value=str;}
if(type=="innerHTML"){return this.obj.innerHTML=str;}
if(type=="checked"){return this.obj.checked=str;}
};
$.prototype.set = function(type,str){
if(type=="value"){this.obj.value=str; return;}
if(type=="innerHTML"){this.obj.innerHTML=str; return;}
if(type=="checked"){this.obj.checked=str; return;}
};
$.prototype.add = function(type,str){
if(type=="value"){this.obj.value+=str; return;}
if(type=="innerHTML"){this.obj.innerHTML+=str; return;}
if(type=="checked"){this.obj.checked+=str; return;}
};
</script>
列举又列举不完,又找不到好方法。。。。。。。。
评论Feed: http://ifisker.com/blog/feed.asp?q=comment&id=1057
引用链接: loading...
浏览模式: 显示全部 |评论: 1 |引用: 0 | 排序 | 浏览: 0
[ 2008-03-13 01:13:08 ]
都是高级语言,我太菜了

