美文网首页
jquery的元素选择器

jquery的元素选择器

作者: 有点皮的小黄皮 | 来源:发表于2019-12-25 21:46 被阅读0次

    jquery的元素选择器

    jQuery选择器是使用封装好的sizzle库

    /*!
     * jQuery JavaScript Library v3.4.1
     * https://jquery.com/
     *
     * Includes Sizzle.js
     * https://sizzlejs.com/
     *
     * Copyright JS Foundation and other contributors
     * Released under the MIT license
     * https://jquery.org/license
     *
     * Date: 2019-05-01T21:04Z
     */
    

    示例

    // 引入Sizzle.js后
    
    var $ = Sizzle;
    console.log($('div')) // 输出所有div数组
    console.log($('#divid')) // 输出id为“divid”的元素
    
    

    相关文章

      网友评论

          本文标题:jquery的元素选择器

          本文链接:https://www.haomeiwen.com/subject/kdehoctx.html