<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
        主站蜘蛛池模板: 成年性羞羞视频免费观看无限| 亚洲AV无码不卡无码| 亚洲国产天堂久久久久久| 国产一区二区三区免费看| 免费午夜爽爽爽WWW视频十八禁 | 美女露100%胸无遮挡免费观看| 中日韩亚洲人成无码网站| 亚洲人成电影网站色www| 污网站在线观看免费| 国产自国产自愉自愉免费24区| 在线看片免费人成视久网| 性做久久久久免费观看| 亚洲欧洲国产精品香蕉网| 免费无码成人AV片在线在线播放| 一区二区三区免费看| 狠狠色伊人亚洲综合网站色| 亚洲日韩精品射精日| 亚洲女人影院想要爱| 亚洲av成人一区二区三区观看在线 | 亚洲av永久无码精品表情包| 亚洲福利视频网站| 色欲aⅴ亚洲情无码AV| 男人进去女人爽免费视频国产| 免费看www视频| 亚洲精品国产福利片| 国产亚洲欧美日韩亚洲中文色| 国内精品免费久久影院| 免费成人午夜视频| 亚洲欧洲自拍拍偷综合| 不卡视频免费在线观看| 女人18毛片免费观看| 亚洲色大成网站www久久九| 杨幂最新免费特级毛片| 夜夜爽免费888视频| 666精品国产精品亚洲| 成人自慰女黄网站免费大全| 亚洲第一页日韩专区| 免费一区二区无码视频在线播放| 大陆一级毛片免费视频观看| 亚洲中文字幕一二三四区| 99精品视频在线视频免费观看|