I am using JQuery.live() functionality to trap click event of any label in a <div>. But when clicked, I want to get the text of the clicked label. I tried $(this).text, but it displays the entire code.
I am using JQuery.live() functionality to trap click event of any label in a
Share
$(this).textreturns the code of the function namedtext.You have to CALL the method, using:
var myText = $(this).text();to get the text or:$(this).text('some text');to set it