我用$('.TreeView1_0');获取了所有class=‘TreeView1_0'的元素集合,请问用什么方法获取$('.TreeView1_0')的元素个数,还有第某个元素??
解决方案 »
- 求助:当鼠标滑过某一个选项后,显示该选项下面的 所有信息,其他选择的内容全部隐藏。
- ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●测试clearAttributes ,什么是script-only???????????????????
- 寻求一段JavaScript代码!
- ff拖动的例子
- 求助!想实现点击链接后,直接将地址直接显示在页面中的input栏中
- 请问用JAVASCRIPT写个滚动新闻问题?
- 一种关于popup窗体事件的接收解决办法,欢迎大家讨论~
- 各位大哥,请问
- 一个简单的js效果实现问题
- arcgis api for JavaScript 在线修改字段属性
- js在Firefox中报错
- Cookie问题。有点灵异现象
$('.TreeView1_0')[0]
$('.TreeView1_0').length;
$('.TreeView1_0')[0]//这个是不可以的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.test{
width:200px;
height:30px;
border:1px solid blue;
}
</style>
<script src="jquery-1.3.2.js"></script>
<script>
$(document).ready(function(){
alert($(".test").length);
alert($(".test:eq(0)").text())//第一个
});
</script></head><body>
<div class="test" id="1">1</div>
<div class="test">2</div>
<div class="test">3</div>
<div class="test">4</div>
</body>
</html>
这样是可以的
$('.TreeView1_0:eq(0)')//这样是可以的