Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 JQM 的两个不同页面中有相同的 id。
问题:
我如何能够使用页面 id 访问这些 id,因为我们知道在 JQM 中每个页面都有自己的 id:
$('#pageId #textfieldId').val();
还是有什么不同?
使用以下代码获取活动页面中文本区域的值。
$.mobile.activePage.find('textarea').val();
代替:
利用:
$('.pageId .textfieldId').val();
您只能触发唯一 ID
$('#pageId').find('textfieldId').val();