jQuery: Get one of a set of selected elements

Posted by Rosarch on Stack Overflow See other posts from Stack Overflow or by Rosarch
Published on 2010-06-06T00:32:19Z Indexed on 2010/06/06 0:42 UTC
Read the original article Hit count: 283

Filed under:
|

There are several elements that are selected by $("#foo"). $("#foo").text() returns the text of each element concatenated together. I just want the text of one element. What is the best way to do this?

$("#foo")[0].text() fails.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery