zoukankan      html  css  js  c++  java
  • jquery 模糊查询对象属性

    1.如果你需要查询的对象属性id的值包含这样的值,你可以这样读取所有此条件的对象

        $("input[id*='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }

    2.如果你需要查询的对象属性id的值以DiscountType起始位置开始,你可以这样读取所有此条件的对象

        $("input[id^='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }

    3.如果你需要查询的对象属性id的值以DiscountType结束,你可以这样读取所有此条件的对象

         $("input[id$='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }

    4.如果你需要查询的对象属性id的值不等于DiscountType,你可以这样读取所有此条件的对象

        $("input[id!='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }

    5.如果你需要查询的对象属性id的值包含DiscountType,以空格分隔,你可以这样读取所有此条件的对象

         $("input[id~='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }

    6.如果你需要查询的对象属性id的值是等于给定字符串或以该字符串后跟一个以连字符开始的值,你可以这样读取所有此条件的对象

         $("input[id|='DiscountType']").each(function (i, el) {
             //It'll be an array of elements
         }
  • 相关阅读:
    团队开发5
    团队开发4
    团队开发3
    团队开发2
    团队开发1
    团队计划会议
    寒假学习进度---完结篇
    寒假学习进度十七
    寒假学习进度十六
    python后续学习
  • 原文地址:https://www.cnblogs.com/david1989/p/3759705.html
Copyright © 2011-2022 走看看