Reputation: 6062
I have made three html tables with id's are "table1","table2" and "table3". I am able to get the id of first table. How to get Id of all three tables and then show these Id in output using JQuery. For e.g Table Id's are : "table1" then "table2" and then "table3"
Upvotes: 1
Views: 9179
Reputation: 846
I suppose you're using a selector on some other properties, since I miss the point of getting IDs you already know. By the way, you can cycle on your selected set with each() and get your Element's IDs. Example:
$('table').each(function() {
alert( $(this).attr('id') );
}
Upvotes: 0