jQuery.inArray(value, array)
概述
确定第一个参数在数组中的位置,从0开始计数(如果没有找到则返回 -1 )。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery.inArray判断标签class属性中是否存在“f14”</title>
<style>
.f14{font-size:14px;}
.f15{font-size: 15px;}
.red{color:red;}
</style>
<script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
</head>
<body>
<h2 class="f14 red">
标题1
</h2>
<script>
$(function(){
var str = $("h2").attr("class");
var strs = str.split(" ");
var yz = $.inArray("f14", strs);
if(yz!=-1){
alert("存在!");
}else{
alert("不存在!");
}
});
</script>
</body>
</html>
分享到:
相关推荐
11.2.6 jQuery.inArray(value, array) 187 11.2.7 jQuery.toArray() 188 11.2.8 jQuery.merge(first, second) 188 11.2.9 jQuery.unique(array) 189 11.2.10 jQuery.parseJSON(json) 189 11.3 函数操作 190 11.3.1 ...
numjQuery.inArray( val, array ) arrjQuery.merge( first, second ) fnjQuery.noop fnjQuery.proxy( fn, scope ), jQuery.proxy( scope, name ) fnjQuery.sub( )1.5+ arrjQuery.unique( array ) strjQuery.trim( ...
jQuery1.2 API 中文版折叠展开折叠全部展开全部 英文说明 核心jQuery 核心函数 jQuery(expression,[context]) jQuery(expression,[context]) 这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组...
$.inArray(value, array) $.merge(first, second) $.unique(array) 测试操作 $.isArray(obj) $.isFunction(obj) 字符串操作 $.trim(str) URL $.param(obj) 关于 关于jQuery 1.3 版翻译 关于jQuery 1.2 版...
$.inArray(value, array) $.merge(first, second) $.unique(array) 测试操作 $.isArray(obj) $.isFunction(obj) 字符串操作 $.trim(str) URL $.param(obj) 关于 关于jQuery 1.3 版翻译 关于jQuery 1.2 版...
+ 工具inArray函数 * noConflict注释 2008-05-27 22:48:24 +0800 + 更新ajax部分的内容,与官网保持一致 2008-05-27 20:39:03 +0800 * 对scroll的示例代码错误的修正 * 由$(document).scroll();到$(window).scroll...
jQuery 1.11.0 速查表 核心 jQuery 核心函数 jQuery([sel,[context]]) jQuery(html,[ownerDoc])1.8* jQuery(callback) jQuery.holdReady(hold) jQuery 对象访问 each(callback) size() length selector ...
+ 工具inArray函数 * noConflict注释 2008-05-27 22:48:24 +0800 + 更新ajax部分的内容,与官网保持一致 2008-05-27 20:39:03 +0800 * 对scroll的示例代码错误的修正 * 由$(document).scroll();到$(window).scroll...
for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e]...
$.inArray(value, array) $.toArray() $.merge(first, second) $.unique(array) $.parseJSON(json) 函数操作 $.noop $.proxy(function, scope) 测试操作 $.contains(container, contained) $.isArray(obj) $.is...
tips[35] = '网站平台需要具备自发的公平属性,以直接交易和交换为先导,广泛参与,达到普及,这才能算平台。'; tips[36] = '所谓“网站定位”就是实事求是的基于各种现状总结出一个对内容建设、功能规划、服务运营...
combobox: The 'groupField' and 'groupFormatter' options are available to display items in groups. tree: When append or insert nodes, the 'data' parameter accepts one or more nodes data. tree: The '...
* No jQuery (but there is [support](#jq)) ### Articles * [Sortable v1.0 — New capabilities](https://github.com/RubaXa/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014...
jQuery doesn’t have a concept of an underlying data model, so to get the number of items you have to infer it from the number of TRs in a table or the number of DIVs with a certain CSS class....
31、java 中会存在内存泄漏吗,请简单描述。 11 32、abstract 的method 是否可同时是static,是否可同时是native,是否可同时是synchronized? 11 33、静态变量和实例变量的区别? 11 34、是否可以从一个static 方法...
31、java 中会存在内存泄漏吗,请简单描述。 11 32、abstract 的method 是否可同时是static,是否可同时是native,是否可同时是synchronized? 11 33、静态变量和实例变量的区别? 11 34、是否可以从一个static 方法...