Selecting all elements

Posted by Eelke on Stack Overflow See other posts from Stack Overflow or by Eelke
Published on 2010-06-15T17:33:00Z Indexed on 2010/06/15 17:42 UTC
Read the original article Hit count: 229

Filed under:
|

This should be really simple but I'm a javascript/jQuery rookie, so here we go:

With the following code I can select a certain element

var user = $(".ui-selected .user-name").html();

But if there are multiple elements with the above classes, only the first value gets selected. What I would like to accomplish is a variable with all the elements seperated by a , like: user1,user2,user3 ... etc. Any help would be greatly appreciated, thanks in advance!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery