Q:

Multiple tables in html have the same id selector and one of them needs to be hidden on click

I have multiple tables with the same id and I want to hide a particular table when it is clicked.
Please suggest me about how to do it.

A:

Always use unique ID ,its the best practice,classes are not Unique
classTable=> class given to all tables
And the id for each table is Unique .
<script>
$(".classTable").click(function() {

    var tblId=$(this).attr("id");
    alert(tblId);
    $("#"+tblId).hide();
});
</script>

on any table User clicks , Get id of the current Table class which is clicked.And hide only those class by taking its ID ,As IDs are unique
Fiddle =>http://jsfiddle.net/c7F7a/

