jquery 问题,在线等待,测试过了,立马结贴。100分。 <a id="videoCollegeId" class="select" id_data ="1" href="javaScript:void(0);" >电学院</a>用jquery 怎么拿到id_data的值。 单独的id 是拿不出来的,必须id和class 合着才能拿到 jquery 怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $('a[class="select"][id="videoCollegeId"]') var value=documentElementById("videoCollegeId").id_data;原生js轻松搞定 $('a[class="select"][id="videoCollegeId"]').attr("id_data") 为什么单独的Id拿不出来???$('#videoCollegeId').each(function(){ if(this.className == 'select') return $(this);}).attr('id_data');或者$('.select).each(function(){ if(this.id== videoCollegeId') return $(this);}).attr('id_data'); $('a[class="select"][id="videoCollegeId"]').attr("id_data")$('a[class="select"][id="videoCollegeId"]').prop("id_data") var id_data = $("a.select#videoCollegeId").attr("id_data"); $(".videoCollegeId[class=select]").attr("id_data"); $("#videoCollegeId").attr("id_data"),这个属性不是标准的,可能会引起兼容性问题,不建议你这么做。 javascript关于控件的控制 一个alert换行的问题! 如何设置dhtmlxtree的checkbox给选中? <script>的一个模糊查询SQL数据库的 如何将文件保存在站点下,或者在站点下的文件中创建文件 不点击一个脚本元素,如何获取脚本指向的url 【求助】aptana IDE的插件问题 可编辑div中通过某时间动态加入内容后,将光标跳到最后一行 如何使用javascript事件注册方法 parent.document 在360里不兼容么 关于document.write()? js写一个嵌入自定义控件方法
原生js轻松搞定
$('#videoCollegeId').each(function(){
if(this.className == 'select')
return $(this);
}).attr('id_data');或者
$('.select).each(function(){
if(this.id== videoCollegeId')
return $(this);
}).attr('id_data');
$('a[class="select"][id="videoCollegeId"]').prop("id_data")