Possible to get list item (<li>) label with javascript?

Posted by matthew Rhodes on Stack Overflow See other posts from Stack Overflow or by matthew Rhodes
Published on 2010-05-10T03:53:00Z Indexed on 2010/05/10 3:58 UTC
Read the original article Hit count: 380

Filed under:
|
|
|

If I've got a ul with 3 items in it and the list-style-type is set to lower-alpha, I end up with this

a. Item 1

b. Item 2

c. Item 3

With jQuery, I can easily get the value of any item you click - "Item 1" if I click the first. But can I get the list item label? in this case 'a'?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery