zoukankan      html  css  js  c++  java
  • jquery foreach

    Js代码
    1. <form id="input_iForm" action="${pageContext.request.contextPath}/transfer/input_salary.shtml">  
    2.    
    3. <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    4.    
    5.       <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    6.    
    7.       <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    8.    
    9. </form>  
    10.    
    11.    
    12.    
    13.    
    14.    
    15. $("input").each(function(index){ //取得整个页面的input值  
    16.    
    17. $("input:text").each(function(index){  
    18.   alert(index);//循环的下标值,从0开始  
    19.   alert(this.value);  alert($(this).attr("type"));  //自带属性可以用this(Dom)直接取值  
    20.   alert($(this).attr("vili"));                               //自定义属性需要用attr(Jquery)取值  
    21.   //if($(this).attr("vili")=="true"&&){  
    22.       
    23.   //}  
    24.  });   
    Js代码
    1. $.ajax({  
    2.       url: '<%=basePath%>schedule/getMonthRecordLs.action',  
    3.       dataType: 'json',  
    4.       success: function(data) {  
    5.           var events = [];  
    6.           $(data).each(function(i,val) {  
    7.               events.push({  
    8.                 id: val.sc_id,  
    9.                   title: val.sc_planemp,  
    10.                   start: new Date(val.sc_date),  
    11.                   color: val.sc_classes=='1'?'':'#993300'  
    12.               });  
    13.           });  
    14.           callback(events);  
    15.       }  
    16.   }); 
  • 相关阅读:
    hlgoj 1766 Cubing
    Reverse Linked List
    String to Integer
    Bitwise AND of Numbers Range
    Best Time to Buy and Sell Stock III
    First Missing Positive
    Permutation Sequence
    Next Permutation
    Gray Code
    Number of Islands
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3265375.html
Copyright © 2011-2022 走看看