So I would like to set a variable to the text of an element when that element is clicked:
$('.clickme').click(function() {
var selected;
var selected = this.text();
});
I’ve looked at the documentation and I believe this should work. Any ideas what the issue might be?
Try:
If no luck, maybe it’s form element so it has value:
If still no luck let us know what is
clickme(div? span?) and try this as “last resort”: