JQuery-each遍历

$("input").each(function(index){
    // index 当前元素的下标
    c = $(this).val();  //当前val
    demo = $("input").eq(index).val();  //通过index获取指定元素的val eq(1)  获取第一个li
});

 

posted @ 2019-08-08 23:54  GJH-  阅读(117)  评论(0)    收藏  举报