js中用this时候没得到当前对象值?小弟代码如下 onclick="disable_chk(this)"function disable_chk(o)var id = o.value; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 use id.id="house_name2"document.getElementById("house_name"+id). function disable_chk(hoho){ var id=hoho.value; //alert(id); document.getElementByName("house_name"+id).disabled=true; return; }....<body><td width="5" height="13"><input type="checkbox" name="update" value=2 onclick="disable_chk(this)"></td> 在函数中,如果想使用this,下面这种情况可以String.prototype.test = function(){ alert(this);}此时,this代表String对象 document.getElementByName("house_name"+id).disabled=true;the program segment is errorif you want to do that, you'd must replace it with the next:document.getElementByName(eval("house_name"+id)).disabled = true;you will be okay!!!!!!!!!!!! js如何修改style内部的内容? 用js如何读取CDATA中的数据 一个抽奖程序的问题。 控制链接颜色代码! EXT中有个浏览器判断的方法,那里定义的那些全局变量为啥我不能直接用啊? [紧急][在线等]请问这段代码在IE7 FF下都可以用,但是为什么IE6不行呢~而且,在FF下还提示使用过时的方法,请问应该怎么修改呢,谢谢~ jquery combobox和Array有冲突??? 接触jquery闭包的问题 如果用td模拟一个button? 高分求救!!如何实现表格的打印?? 我想一个提交事件可以解决两个sub 关于用在TABLE里 选种checkbox 后 删除的问题
id="house_name2"
document.getElementById("house_name"+id).
{
var id=hoho.value;
//alert(id);
document.getElementByName("house_name"+id).disabled=true;
return;
}
....
<body>
<td width="5" height="13"><input type="checkbox" name="update" value=2 onclick="disable_chk(this)"></td>
{
alert(this);
}此时,this代表String对象