如何动态选中单选按钮 本帖最后由 CNLAN 于 2009-11-21 10:46:48 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $("#My").click(function() {} 可以这样吗?试试绑定事件的方法 $("#My").bind('click', function(){} ) $('input[name=Mytest]:first').attr("checked", true); or$('input[name=Mytest]').eq(0).attr("checked", true);or$('input[name=Mytest]')[0].checked = true;or$('input[name=Mytest][value=abc]').attr("checked", true);or... $(document).ready(function() { $("#My").click(function() { $('input[name=Mytest].eq(0)').attr("checked", "abc"); }); });试试 $("input[name=Mytest]").attr("checked", "checked"); $("#My").bind('click',function() { $('input[name=Mytest]:first').attr("checked", "abc"); }); });或者 $("#My").bind('click',function() { $('input[name=Mytest]:eq(0)').attr("checked", true); });都可以 最终结果可以使用:$('input[name=Mytest][value=abc]').attr("checked", true); 自定义URL Protocol来调用应用程序 急 帮忙看看下面的代码哪里出错了~ drop效果是怎么实现的 JS读取远程数据出现乱码 熟悉MooTools的朋友来帮忙看看 谁有类似于126,163,yahoo邮箱里面每打开一封邮件就会多出一个选项卡出来 网页里播放avi,wmv,rm,mov等视频,请问如何用脚本控制播放,暂停,快进,快退,以及音量等,最好能有相关的资料。 怎样把cab让用户自己安装 字符串替换问题? 窗口事件 我想做一个网上在线学习时间控制和统计 为什么window.open调用不成功
试试绑定事件的方法 $("#My").bind('click', function(){} )
or
$('input[name=Mytest]').eq(0).attr("checked", true);
or
$('input[name=Mytest]')[0].checked = true;
or
$('input[name=Mytest][value=abc]').attr("checked", true);
or
...
$(document).ready(function() {
$("#My").click(function() { $('input[name=Mytest].eq(0)').attr("checked", "abc");
});
});
试试
$('input[name=Mytest]:first').attr("checked", "abc");
});
});或者
$("#My").bind('click',function() {
$('input[name=Mytest]:eq(0)').attr("checked", true);
});都可以