jQuery只适用于第一个div

Click works just on first div with id plus but other divs with the same id dont work. I dont know whats the problem... I dont get what the problem is. Please help. Thanks! Here is the code... Edited:

<div id="details">
    <div id="detailHeader">
        <div id="facultyTitle">sadasdas</div>
        <div id="title">dsadasdasdas</div>
    </div>
    <div id="detailReference">
        dodaj
        <div id="refVote">
            <div class="plus" glas="41">Good</div>
            <div class="minus" glas="41">Bad</div>
        </div>
        <div id="referenceInfo">
            01:40 PM 06.09.2014. 
        </div>
    </div>
</div>
<div id="detailReference">
    dodaj
    <div id="refVote">
        <div class="plus" glas="37">Good</div>
        <div class="minus" glas="37">Bad</div>
    </div>
    <div id="referenceInfo">
        01:38 PM 06.09.2014. 
    </div>
</div>
 </div>

JavaScript

$(".plus").click( function() {
    var ref=$(this).attr("glas");
        alert(ref);
        $.ajax({
            url:"url is ok",
            success:function(){

            }
        }
    );
});

IDs should be unique. use same class instead of ids.Like this:

 <div class="plus" glas="37">Good</div>

and then use:

 $(".plus").click( function() {
          var ref=$(this).attr("glas");
          alert(ref);
          $.ajax({
           url:"url is ok",

            success:function(){
                   }
             }
        );

I have to use class if you have more than one div. Try with .plus

$(".plus").click(...)

not

$("#plus").click(...)

There can and shall only be one item with a certain ID on the page. Use classes on those buttons instead.

Couple of issues. You have mismatched divs. This last div looks like its the culprit.

<div id="details">
<div id="detailHeader">
<div id="facultyTitle">sadasdas</div>
<div id="title">dsadasdasdas</div>
</div> <--this one

Your second issue is that you shouldnt have multiple ids that are the same on a page. Instead set it as a class with

<div class="plus"> Then reference them in jquery with 

$(".plus").click( function()