<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        再談querySelector和querySelectorAll的區別與聯系_javascript技巧

        來源:懂視網 責編:小采 時間:2020-11-27 21:02:53
        文檔

        再談querySelector和querySelectorAll的區別與聯系_javascript技巧

        再談querySelector和querySelectorAll的區別與聯系_javascript技巧:先按W3C的規范來說這兩個方法應該返回的內容吧: querySelector: return the first matching Element node within the node's subtrees. If there is no such node, the method must return null.(返回指定元素節
        推薦度:
        導讀再談querySelector和querySelectorAll的區別與聯系_javascript技巧:先按W3C的規范來說這兩個方法應該返回的內容吧: querySelector: return the first matching Element node within the node's subtrees. If there is no such node, the method must return null.(返回指定元素節

        先按W3C的規范來說這兩個方法應該返回的內容吧:
        querySelector:

        return the first matching Element node within the node's subtrees. If there is no such node, the method must return null.(返回指定元素節點的子樹中匹配selector的集合中的第一個,如果沒有匹配,返回null)

        querySelectorAll:

        return a NodeList containing all of the matching Element nodes within the node's subtrees, in document order. If there are no such nodes, the method must return an empty NodeList. (返回指定元素節點的子樹中匹配selector的節點集合,采用的是深度優先預查找;如果沒有匹配的,這個方法返回空集合)

        使用方法:
        代碼如下:
        var element = baseElement.querySelector(selectors);
        var elementList = baseElement.querySelectorAll(selectors);

        這在BaseElement 為document的時候,沒有什么問題,各瀏覽器的實現基本一致;但是,當BaseElement 為一個普通的dom Node的時候(支持這兩個方法的dom Node),瀏覽器的實現就有點奇怪了,舉個例子:
        代碼如下:

        Test



        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        再談querySelector和querySelectorAll的區別與聯系_javascript技巧

        再談querySelector和querySelectorAll的區別與聯系_javascript技巧:先按W3C的規范來說這兩個方法應該返回的內容吧: querySelector: return the first matching Element node within the node's subtrees. If there is no such node, the method must return null.(返回指定元素節
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲色图综合网站| 亚洲国产成人VA在线观看| 亚洲精品国产精品乱码不卡√| 24小时日本在线www免费的| 久久精品国产亚洲av水果派| 99精品视频在线免费观看| 我想看一级毛片免费的| 亚洲狠狠成人综合网| 99视频在线观看免费| 国产亚洲无线码一区二区| 一个人看的www免费视频在线观看| 成人免费在线观看网站| 亚洲情A成黄在线观看动漫软件| 中国极品美軳免费观看| 在线观看亚洲av每日更新| 日本高清免费观看| 亚洲成av人片一区二区三区 | 亚洲精品123区在线观看| 成人免费视频77777| 亚洲精品色播一区二区| 免费一级毛片不卡在线播放| 人人鲁免费播放视频人人香蕉| 久久久精品免费视频| 免费黄网在线观看| 国产精品亚洲а∨无码播放| 99热这里有免费国产精品| 在线日韩日本国产亚洲| 99国产精品免费观看视频| 亚洲三级高清免费| 久久久久亚洲AV成人网人人软件| 亚洲高清毛片一区二区| AV大片在线无码永久免费| 久久久久亚洲国产AV麻豆 | 亚洲日本韩国在线| 一区二区三区四区免费视频| 亚洲AV一二三区成人影片| 免费中文字幕在线观看| 免费一区二区三区| 337P日本欧洲亚洲大胆艺术图| 在线观看免费人成视频色| 一区二区视频免费观看|