KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to get the first value of span under different li elements. My HTML markup is as follows... <div class="mipartrel"> <div class="k-multiselect-wrap k-floatwrap"> <ul role="listbox" unselectable="on" class="k-reset"> <li class="k-button"> <span>bat</span> <span class="k-icon k-delete">delete</span> </li> <li class="k-button"> <span>ball</span> <span class="k-icon k-delete">delete</span> </li> </ul> </div> </div> I used the following jQuery code to get the text of all the span elements... var getdata=$('.mipartrel ul li span').first().text(); ...but I am only getting the value "bat" . I need each and every value from the first span of every li .
Tags (comma-separated)
Save Edits
Cancel