jquery - how to show list items separately in output using javascript -
I have created a html that has the search box after searching, I'm getting the data in the list but when I click on it I am getting the value of all the list items using In my app, if I click on an item, then I should only give the list item the value which is not other I'm making a mistake somewhere, but not me I know. HTML And here is my javascript code: So when I'm searching for an item I'm getting a list of it: But when I clicked on it, I get the value of both / P> this
var text = $ (this) .text (); Method
Here is my code:
& lt; Ul data-role = "Listview" class = "ui-li-icon" & gt; & Lt; Li id = "list" & gt; & Lt; / li & gt; & Lt; / Ul & gt;
function success callback (feedback OBJ) {// warning (JSON.stringify (responseObj)); Form.reset (); Dataj = JSON.stringify (responseObj); Lane = dataj.length; (I = 0; i
ab abc
ab and
abc . I just want one value where I clicked.
$ ('.ui-li-icon li') . Click (function () {var index = $ (this) .index (); var text = $ (this) .text (); alert ('index is:' + index + 'and text' is text;) ;});
Comments
Post a Comment