javascript $

[ 2007-07-23 14:51:50 | 作者: {$author:name$} ]  编辑  删除
字体大小: | |
其实我也不知道我想写什么

<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 评论Feed: http://ifisker.com/blog/feed.asp?q=comment&id=1057
UTF-8 Encoding 引用链接: loading...

浏览模式: 显示全部 |评论: 1 |引用: 0 | 排序 | 浏览: 0
引用 魔兽世界私服*
[ 2008-03-13 01:13:08 ]  编辑  删除
都是高级语言,我太菜了

发表评论
表情图标
[smile][confused][cool][cry]
[eek][angry][wink][sweat]
[lol][stun][razz][redface]
[rolleyes][sad][yes][no]
[heart][star][music][idea]
UBB代码
转换链接
表情图标
悄悄话
用户名:   密码:   注册?
验证码* 请输入验证码