Page 1 of 1

Dynamic list with label, get label text on javascript click

Posted: Sat Jul 27, 2013 2:54 am
by Houssan Hijazi

Hi,

i have a dynamic list with label, how i can get the text label with javascript click event on the label?

thanks


Dynamic list with label, get label text on javascript click

Posted: Sat Jul 27, 2013 3:15 am
by Igor

HI,

You can use next code:
precode
Appery("mobileselectmenu_16").find(":selected").text()
/code/pre
"mobileselectmenu_16" - component name.


Dynamic list with label, get label text on javascript click

Posted: Sat Jul 27, 2013 3:20 am
by Houssan Hijazi

Sorry, but is not a selectmenu, is a label inside a dynamic list.

breadcrumbs: http://d.pr/i/2fag

i need get the text of label inside the list.

the click event is on label .

thanks


Dynamic list with label, get label text on javascript click

Posted: Sat Jul 27, 2013 3:50 am
by Igor

Please try another code:
precode
$(this).text();
/code/pre


Dynamic list with label, get label text on javascript click

Posted: Wed Jun 18, 2014 7:27 am
by Tooba Atif

I have multiple labels on my list item so how can i get the specific label value?
Like i have label for address, number and name.

I want to store the number in local storage only but using
$(this).text(); will return the text of all labels


Dynamic list with label, get label text on javascript click

Posted: Wed Jun 18, 2014 8:12 am
by Evgene Karachevtsev

Hello Tooba,

Please detail, what do you want to do. On what event do you want to get values? Do you want to on click list items get values of labels, which are inside it?


Dynamic list with label, get label text on javascript click

Posted: Wed Jun 18, 2014 8:15 am
by Tooba Atif

Solved this issue :)
Thanks
I use $(this).find("[name=lblStatus]").text()