I'm rather new to jquery so this may be the issue. I have a script that outputs several divs all with different text data in them. I would like it when I click one of them that an input field's value is updated to that text currently I have:
How can I make it so that whatever link is clicked that is the data that gets updated into the input's value? I can get it to take one or I can script out different cases of each changing the class name but I think there has to be a way where it references whatever link is being clicked instead of what it's currently doing.
Thanks in advance!
I think your solution is correct but there are some syntax errors.
data= this.text(); should be
var data = $(this).text() and
$("a.results]") should be
Try getting rid of your bracket: $("a.results]") - should be $("a.results"). That may help.