关于JS中each用法 jquery?try:$('#COPY').each(function(i){attr("disabled","disabled")}); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $('#COPY').each(function(i){$(this).attr("disabled","disabled")}); 请使用 firebug 捕捉、调试 to:willko还是只作用用第一个#COPY,第二个没反应。to:fredyj语法不会,不会调试,调到这儿错了,不知怎么 写也是白搭 还有一个问题,我想知道有个ID为name的按钮,我要判断是否灰化应该如何写(“#name").disabled==false他又不报错。 看一下Jquery的API应用.http://visualjquery.com/index.xml 楼上的谢谢,俺看了(“#name").disabled==false 这个是我少写一个$关于each,是不是不能用ID,在jquery里面的一个例子用的是HTML标签,我改用了class(.name)也没用 <body><input name="copy" type="button" value="copy" /><input name="copy" type="button" value="copy" /></body>$("input[name='copy']").each(function(i){ this.disabled=true});或者$("input[name='copy']").each(function(i){ $(this).attr('disabled','disabled');});不过这样重名的对象其实是不合标准的jquery说明在这里http://docs.jquery.com/Selectorshttp://docs.jquery.com/Selectors/attributeEquals#attributevalue这里是firebug的使用说明,熟能生巧http://www.ooso.net/index.php/archives/294 谢楼上的,一般ID都是唯一的,可以用.class,我那天改了,可能我的原因,没显示出我要的,过了几天忽然发现好了。你向我介绍的东西我天天在看,特别是jquery文档。第一次做,有些东西看了基本是迷糊之中 jquery很简单 api看一下就全会了 $.each(arr2, function(i, item){ alert("456"); } ); 建站之星和Discuzz比哪个好一些? 为什么这个页面在ie和chrome下显示完全不同? 求助【httpd.exe 】应用程序错误 奇怪的问题 帮忙解答一下 急~~ 高分请教大家详细设计在开发过程中的使用. 谈者有分,不够继续追加 php获取checkbox的值 如何用PHP调用WebService? php 自动提交页面 (急) 一个iis可否开多个泛解析? 从.net想到php(欢迎大家讨论) 配置的是windows2003服务器上的iis6.0 +php5.0 配置无误 测试页面也正常 访问其它页面报500错误 JS传值到PHP
还是只作用用第一个#COPY,第二个没反应。to:fredyj
语法不会,不会调试,调到这儿错了,不知怎么 写也是白搭
(“#name").disabled==false
他又不报错。
(“#name").disabled==false 这个是我少写一个$
关于each,是不是不能用ID,在jquery里面的一个例子用的是HTML标签,我改用了class(.name)也没用
<body>
<input name="copy" type="button" value="copy" />
<input name="copy" type="button" value="copy" />
</body>$("input[name='copy']").each(function(i){
this.disabled=true
});或者$("input[name='copy']").each(function(i){
$(this).attr('disabled','disabled');
});
不过这样重名的对象其实是不合标准的jquery说明在这里
http://docs.jquery.com/Selectorshttp://docs.jquery.com/Selectors/attributeEquals#attributevalue这里是firebug的使用说明,熟能生巧http://www.ooso.net/index.php/archives/294