I have an HTML table and I want to iterate through its rows and create a collection or lets say an \"array of objects\".
For example:
I would suggest changing your html slightly.
User ID
User Name
1
Test1
Then in your javascript when you want to get all the elements as an array you could do.
var userIdArray = $('#tbPermission .userid').map(function(userid){ return $(userid).html(); }).toArray();
This will find all elements with a class userid on the table, collect just the values, and .toArray() that result to get a basic javascript array. You can then take that and manipulate it into whatever json structure you want, or you could possibly create your json object inside that map function.