JQ码:
$("#a").click(function(){
    $(".class").html("这里是内容");
})
HTML:
<a id="a">第一行</a>
<a id="a">第二行</a>
<a id="a">第三行</a>
N行...
以上的代码,只有点击 [第一行] 有效,点击后面的 A标签 就都无效了、我想让无论点击哪个 A标签,都能改变 [.class]的内容。HTML

解决方案 »

  1.   

    $('a').click(function(){
       $(this).html("这里是内容");
    })
      

  2.   

    html中出现同一个id时,浏览器只认识第一个
    jQuery的$("#xx"),相等于document.getElementById("xx");所以只有一个有用,解决方案同意楼上
      

  3.   

    $("#_adopt").click(function(){
    //加载框架
    $($html).appendTo("body");
    $("div[class=win_box]").unbind().addClass("delete");
    $("li[class=name]").unbind().html("标题");
    $("div[class=win_body]").unbind().html($adopt);
    $("li[class=close],em[class=error]").unbind().click(function(){
    $(".win_box,.win").remove()
            }); 
    });
    如果我使用以上代码,什么改?