转:http://blog.csdn.net/echo_heng/article/details/72455350

1.javascript的indexOf()方法

var arr_data = [1,2,3]; 
arr_data.indexOf(1); //如果存在返回值的下标,不存在返回-1

2.jquery的$.inArray()方法

$.inArray(1, arr_data); //如果存在返回值的下标,不存在返回-1

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2021-12-04
  • 2021-08-17
  • 2023-03-14
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案