如何在jquery jquery或javascript phonegap中获得锚标记
how to get anchor tag in ul li jquerymobile jquery or javascript phonegap
我在phonegap工作,我想计算锚标记的主题,这里是我的代码
我只是想在li
<ul id='uSignUp' onclick="getlistitem()" data-role='listview' data-inset='true' data-split-theme="d" data-theme="a">
<li><a href='#' rel="external">Accessing Your Needs</a>
<a href="#" data-theme="b" id="A_an" data-icon="check"> Accessing your needs status</a>
</li>
<li><a href='#' onclick="ToShowDF();" rel="external">Develop Your Fitness</a>
<a href="#" data-theme="b" id="A_df" data-icon="check"> Develop your fitness status</a>
</li>
<li><a href='#' onclick="ToShowPQ();" rel="external">PAR-Q</a>
<a href="#" data-theme="d" id="A_pq" data-icon="check"> PAR-Q Form</a>
</li>
<li><a href='#' onclick="ToShowLS();" rel="external">Lifestyle Related Questions</a>
<a href="#" data-theme="d" id="A_ls" data-icon="check"> LifeStyle status</a>
</li>
<li><a href='#' onclick="ToShowTNC();" rel="external">Terms And Conditions</a>
<a href="#" data-theme="d" id='A_Tnc' data-icon="check"> Terms and Conditions status</a>
</li>
<li><a href='#' onclick="ToShowIND();" rel="external">Indemnity Declaration</a>
<a href="#" data-theme="d" id='A_ind' data-icon="check"> Indemnity declaration status</a>
</li>
</ul>
当我在firebug中调试代码时,它向我展示了一个div和一个锚标记,在锚标记中有两个span,在第二个span上我需要那个。
有人能帮忙吗?
Try with:
var countB = $('#uSignUp [data-theme="b"]').length;
alert( countB );
小提琴演示
var count = 0;
$('#uSignUp > li > a').each(function() {
var theme = $(this).data("theme");
if (theme != undefined && theme == 'b') {
//console.log($(this).data("theme"));
count++;
}
})
alert(count);
小提琴
相关文章:
- 使用jquery解析phonegap中的json数据
- android phonegap jquery点击动态列表中的元素
- 使用PhoneGap和jQuery Mobile在android设备上显示动态列表视图
- jquery保存数据,直到phonegap应用程序关闭
- 使用phonegap在jquery-mobile中链接页面/加载javascript的最佳实践是什么
- 在phonegap android中上传多个文件时,使用jquery ui显示进度条
- 为什么jquery append没有'不适用于phonegap ios
- 在编译jquery移动代码时,Script标记在Eclipse Phonegap中不起作用
- phonegap +jquery mobile + JSON
- jquery移动phonegap应用程序的语音到文本api
- Phonegap+JQuery Mobile:如何从Android菜单按钮弹出
- Eclipse Phonegap无法使用jquery.load函数加载外部字符串文件
- 如何在iPhone PhoneGap jQuery Mobile中将文件附加到邮件中
- 修复了在 PhoneGap 中使用 jQuery Mobile 的 jQuery 验证中导致错误错误的延迟回调
- 如何在警报框中使用 history.go(-1) Javascript,通过 phonegap 构建 jQuery 移动
- 页面哈希和后退按钮问题 phonegap+Jquery
- 需要有关使用Phonegap和jquery mobile的解决方案的指导
- jQuery $.get 不适用于 Phonegap 或 Mobile Safari 中的“本地”文件
- Cordova(PhoneGap)在jQuery Mobile应用程序的每一页上重新初始化
- 警报(“”);使用 PhoneGap 和 jQuery 的函数