zoukankan      html  css  js  c++  java
  • JS对象数组根据元素属性删除元素和获取元素的方法

    //删除数组元素

    //数组,属性名称,属性值
    function removeCodeNumList(arrPerson, objPropery, objValue) {
    return $.grep(arrPerson, function (cur, i) {

    return cur[objPropery] != objValue;
    });
    }
    //获取数组元素

    //数组,属性名称,属性值
    function getCodeNumList(arrPerson, objPropery, objValue) {
    return $.grep(arrPerson, function (cur, i) {
    return cur[objPropery] == objValue;
    });
    }

  • 相关阅读:
    http方法-get和post
    SVG
    canvas
    h5拖放
    jQuery表单事件
    html标签嵌套
    jquery.eq()
    jquery.index()
    Date对象
    json
  • 原文地址:https://www.cnblogs.com/eryang/p/9431377.html
Copyright © 2011-2022 走看看