久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <i id='BfBDx'><tr id='BfBDx'><dt id='BfBDx'><q id='BfBDx'><span id='BfBDx'><b id='BfBDx'><form id='BfBDx'><ins id='BfBDx'></ins><ul id='BfBDx'></ul><sub id='BfBDx'></sub></form><legend id='BfBDx'></legend><bdo id='BfBDx'><pre id='BfBDx'><center id='BfBDx'></center></pre></bdo></b><th id='BfBDx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BfBDx'><tfoot id='BfBDx'></tfoot><dl id='BfBDx'><fieldset id='BfBDx'></fieldset></dl></div>
    2. <tfoot id='BfBDx'></tfoot>

        <legend id='BfBDx'><style id='BfBDx'><dir id='BfBDx'><q id='BfBDx'></q></dir></style></legend>
      1. <small id='BfBDx'></small><noframes id='BfBDx'>

          <bdo id='BfBDx'></bdo><ul id='BfBDx'></ul>

        如何在 jQuery 屬性選擇器中將邏輯 OR 與邏輯 AND

        How do I combine logical OR with logical AND within a jQuery attribute selector?(如何在 jQuery 屬性選擇器中將邏輯 OR 與邏輯 AND 結合起來?)

          <legend id='76yxB'><style id='76yxB'><dir id='76yxB'><q id='76yxB'></q></dir></style></legend>
        1. <i id='76yxB'><tr id='76yxB'><dt id='76yxB'><q id='76yxB'><span id='76yxB'><b id='76yxB'><form id='76yxB'><ins id='76yxB'></ins><ul id='76yxB'></ul><sub id='76yxB'></sub></form><legend id='76yxB'></legend><bdo id='76yxB'><pre id='76yxB'><center id='76yxB'></center></pre></bdo></b><th id='76yxB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='76yxB'><tfoot id='76yxB'></tfoot><dl id='76yxB'><fieldset id='76yxB'></fieldset></dl></div>
          <tfoot id='76yxB'></tfoot>
              <bdo id='76yxB'></bdo><ul id='76yxB'></ul>
            • <small id='76yxB'></small><noframes id='76yxB'>

                    <tbody id='76yxB'></tbody>
                  本文介紹了如何在 jQuery 屬性選擇器中將邏輯 OR 與邏輯 AND 結合起來?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  給定以下 XML:

                  <users>
                      <user state="CA" sex="m">Max</user>
                      <user state="AZ" sex="f">Jen</user>
                      <user state="OR" sex="f">Kim</user>
                      <user state="NV" sex="m">Bob</user>
                      <user state="CA" sex="m">Jon</user>
                      <user state="AZ" sex="m">Jim</user>
                      <user state="OR" sex="f">Joy</user>
                      <user state="NV" sex="f">Amy</user>
                  </users>
                  

                  使用 jQuery,有沒有辦法選擇男性用戶,來自 CA 或 NV,但不使用過濾功能?說清楚,我知道

                  Using jQuery, is there a way to select users who are male and are either from CA or NV, but without using the filter function? To be clear, I know that

                  $(xml).find("user[sex='m']")
                  

                  只選擇男性用戶,而

                  $(xml).find("user[state='CA'],[state='NV']")
                  

                  從 CA 或 NV 中選擇所有用戶.但我無法在單個選擇器中將它們與邏輯 AND 結合起來.

                  selects all users from either CA or NV. But I am not able to combine both of them with a logical AND within a single selector.

                  但是,使用過濾器功能,以下工作:

                  Using the filter function, however, the following works:

                  $(xml).find("user").filter(function() {
                      return $(this).attr('sex') == 'm' && ($(this).attr('state') == 'CA' || $(this).attr('state') == 'NV')
                  }).each(function() {
                      alert($(this).text());
                  });
                  

                  謝謝!

                  推薦答案

                  試試這個:

                  $(xml).find("user[sex='m'][state='CA'], user[sex='m'][state='NV']")
                  

                  基本上,您將 sexstate 屬性鏈接在一個簡單的選擇器中(這將是您的邏輯與),并在每個狀態重復一次(這將是你的邏輯或).

                  Basically you chain the sex and state attributes together in a single simple selector (this would be your logical AND), and repeat them once per state (and this would be your logical OR).

                  測試:

                  $(xml).find("user[sex='m'][state='CA'], user[sex='m'][state='NV']")
                        .each(function() {
                            alert($(this).text() + " - " + $(this).attr('state'));
                        });
                  

                  輸出:

                  Max - CA
                  Bob - NV
                  Jon - CA
                  

                  這篇關于如何在 jQuery 屬性選擇器中將邏輯 OR 與邏輯 AND 結合起來?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)

                  1. <i id='ixg4T'><tr id='ixg4T'><dt id='ixg4T'><q id='ixg4T'><span id='ixg4T'><b id='ixg4T'><form id='ixg4T'><ins id='ixg4T'></ins><ul id='ixg4T'></ul><sub id='ixg4T'></sub></form><legend id='ixg4T'></legend><bdo id='ixg4T'><pre id='ixg4T'><center id='ixg4T'></center></pre></bdo></b><th id='ixg4T'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ixg4T'><tfoot id='ixg4T'></tfoot><dl id='ixg4T'><fieldset id='ixg4T'></fieldset></dl></div>
                    <tfoot id='ixg4T'></tfoot>
                      <bdo id='ixg4T'></bdo><ul id='ixg4T'></ul>

                        <small id='ixg4T'></small><noframes id='ixg4T'>

                      • <legend id='ixg4T'><style id='ixg4T'><dir id='ixg4T'><q id='ixg4T'></q></dir></style></legend>
                              <tbody id='ixg4T'></tbody>

                            主站蜘蛛池模板: 久久久精品网站 | 国产一区二区中文字幕 | 精品国产一区二区三区久久久久久 | 91xxx在线观看 | 国产精品美女久久久av超清 | 丁香久久 | 日本小电影网站 | 精品国产一区二区三区久久久蜜月 | 中文字幕久久精品 | 亚洲国产成人精 | 久久久久久久久久久一区二区 | 日本免费一区二区三区四区 | 欧美日韩电影一区二区 | 中文字幕电影在线观看 | 一级黄色片日本 | 国产成人精品一区二 | 在线观看中文字幕 | 国产精品久久国产愉拍 | 日韩在线小视频 | 久久久成人一区二区免费影院 | 亚州影院| 天天操人人干 | 欧美午夜精品理论片a级按摩 | 亚洲 自拍 另类 欧美 丝袜 | 成人影院午夜 | 人人干人人超 | 99精品久久 | 国产精品精品视频一区二区三区 | 国产精品不卡视频 | 亚洲精品一二区 | 免费在线h视频 | 天天影视色综合 | 国产成人黄色 | 一区二区免费在线观看 | 999精品视频 | 国产精品小视频在线观看 | 狠狠骚| 久久这里有精品 | 亚洲精品成人在线 | 国产一区二区三区精品久久久 | 人干人人|