Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
var eg = "a,b,c,d";
var eg = "a,b,c,d"; eg.split(",")[2];
Add a comment
jQuery.split = function(s, d){return s.split(d)}
$.split("a,b,c,d", ",")[2]
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
var eg = "a,b,c,d";