日期:2014-05-16  浏览次数:20330 次

jquery取得所有div的class name是test的代码
var jdiv = $("div.test");

这样写对么?

之后我想取得里边的属性,该怎样操作?
例如我想取top或者id之类的?

thx

------解决方案--------------------
查jquery each 这是遍历的
$("div.test").each(function(){
alert($(this).text())
});
你那样写也行,都可以,再说实践出真知
你试一下不就知道行不行了嘛,呵呵
------解决方案--------------------
$("div .test")