解决方案 »

  1.   

    $(function (){
        $(".span_class").find("span").each(function() {
            $(this).hover(function () {
                    //alert("#"+"id")获取每个id和class
    alert($(this).attr("id"));
    alert($(this).attr("class"));
                },function () {
                    //$(this).removeClass("class_up");
                }
            );
        });
    });
      

  2.   

    $(".span_class")上直接绑定hover事件,不用循环
    http://www.pcxyz.com/#p=hover
      

  3.   

    这jQuery用的,
    this本来就是个dom element,你想那样处理就那样处理。
      

  4.   


    $(".span_class").find("span").each(function() {
    $(this).hover(function () {
                   //this就是这个DOM对象,$(this)指的是这个DOM对象封装的jquery对象->$(this)[0] = this
    alert(this.id)
    alert(this.className)
    },function () {
    //$(this).removeClass("class_up");
    });
    });