Topic: It doesn't work jquery...

Hi all! I want to add alert message via jquery when User clicks <div id="star">star</div>.
But, It can't work. 
Please teach me some advice.

Thanks!

# posts/index.html.erb

...
<% @posts.each do |post| %>
  <tr>
    <td><%= post.id %></td>
    <td><%= post.content %></td>
    <td></td>
    <div id="like">
      <td>like</td>
    </div>
    <td><div id="star">star</div></td>
    <td><%= post.created_at.strftime("%Y年%m月%d日%H:%M:%S") %></td>
<% end %>
</tr>
</table>

....

# application.js

$(document).ready(function() {
   $("#star").click(function(){
     alert("add_star");
   })
 });

Re: It doesn't work jquery...

Do you have jquery.js included in your app? Check app's html source if jquery is correctly set.

Re: It doesn't work jquery...

Thanks It worked.
I made a awful error. I update the <div> to <class...> ,then It worked correctly.