久久久久久久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>

                            主站蜘蛛池模板: 日韩一区二区在线视频 | 福利精品在线观看 | 在线三级电影 | 粉嫩一区二区三区四区公司1 | 福利网址 | 免费一级黄色 | a级毛片毛片免费观看久潮喷 | 99久久精品国产一区二区三区 | 精品国产91 | 91性高湖久久久久久久久_久久99 | 福利片在线看 | 国产精品污www一区二区三区 | 精品欧美久久 | 一区二区三区久久 | 99精品亚洲国产精品久久不卡 | 国产91在线播放 | 免费观看一级毛片 | 一区二区三区国产精品 | 日韩欧美三区 | 欧美精品久久久 | 精品国产乱码久久久久久a丨 | 久久精品国产a三级三级三级 | 老牛嫩草一区二区三区av | 亚洲精品免费在线观看 | 91在线视频观看免费 | 久久91 | 国产免费一区二区三区网站免费 | 亚洲福利片 | 欧美成年网站 | 日韩国产三区 | 精品一二三| 亚洲一区二区三区视频 | 亚洲在线一区 | 国产精品久久久久久久久久 | 51ⅴ精品国产91久久久久久 | 人人干人人超 | 欧美日韩一区二区三区不卡视频 | 亚洲成人av在线 | 国产精品美女久久久久aⅴ国产馆 | 看片一区 | 欧美中文字幕在线 |