Reputation: 12105
Is there a simple one liner I can use to select the nth element from a comma separated list in jQuery?
For example if I have: var eg = "a,b,c,d";
How can I select element c?
Upvotes: 0
Views: 1235
Reputation: 22268
var eg = "a,b,c,d"; eg.split(",")[2];
Upvotes: 5