jQuery length 属性

jQuery 教程 · 2019-03-30 08:19:31

实例

输出 <li> 元素的数目:

$("button").click(function(){
    alert($("li").length);
});

定义和用法

length 属性包含 jQuery 对象中元素的数目。

语法

$(selector).length

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

DOM Scripting

DOM Scripting

Jeremy Keith / friendsofED / 2010-12 / GBP 27.50

There are three main technologies married together to create usable, standards-compliant web designs: XHTML for data structure, Cascading Style Sheets for styling your data, and JavaScript for adding ......一起来看看 《DOM Scripting》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

html转js在线工具
html转js在线工具

html转js在线工具