学习笔记_jquery(js)遍历页面标签
生活随笔
收集整理的這篇文章主要介紹了
学习笔记_jquery(js)遍历页面标签
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
$('#selectTable tr').each(function(i){ // 遍歷 tr
? ? ?? ? $(this).children('td').each(function(j){ // 遍歷td
? ? ?? ? ? ? var id = $(this).context.id;?
? ? ?? ? ?});
? ? ?});
//----------------------
?$("input[name='name1']").each(function(){ //遍歷name=name1 的input
? ? ? ? ? var id = $(this).context.id;
??? ? ? ? var v= $(this).context.value;
})
?$("input").each(function(){ //遍歷所有input
? ? ? ? ? var id = $(this).context.id;
? ? ? ? ? var v= $(this).context.value;
})
$("body").find("input").each(function(){ //遍歷body中所有input?
?? ??? ? $(this).attr('readonly','true');
?? ??? ?});
總結
以上是生活随笔為你收集整理的学习笔记_jquery(js)遍历页面标签的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ext grid 根据行号获取行数据
- 下一篇: jwt重放攻击_4个点搞懂JWT、JWS