jQuery is() 方法
jQuery 教程
· 2019-03-28 07:38:45
实例
如果 <p> 的父元素是 <div> 元素,弹出提示信息:
if ($("p").parent().is("div")) {
alert("p 的父元素是 div");
}
alert("p 的父元素是 div");
}
定义和使用
is() 方法用于查看选择的元素是否匹配选择器。
语法
$(selector).is(selectorElement,function(index,element))
| 参数 | 描述 |
|---|---|
| selectorElement | 必须。选择器表达式,根据选择器/元素/jQuery 对象检查匹配元素集合,如果存在至少一个匹配元素,则返回 true,否则返回 false |
| function(index,element) |
可选。指定了选择元素组要执行的函数。
|
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Agile Web Development with Rails, Third Edition
Sam Ruby、Dave Thomas、David Heinemeier Hansson / Pragmatic Bookshelf / 2009-03-17 / USD 43.95
Rails just keeps on changing. Rails 2, released in 2008, brings hundreds of improvements, including new support for RESTful applications, new generator options, and so on. And, as importantly, we’ve a......一起来看看 《Agile Web Development with Rails, Third Edition》 这本书的介绍吧!