What I need is the \"this\" value of
( $(this).attr(\"value\"));
to show up in the \"this\" of
$(\"#activities_\" +btn_id).val
If you want to get the value of the .thoughts_list
element when you click the #close_thoughts
element you'll need this:
$('#close_thoughts').click(function(){
$("#activities_" + btn_id).val($('.thoughts_list').val());
});
Your code was setup as follows:
$('#close_thoughts').click(function(){
$("#activities_" +btn_id).val($(this).val());
});
The problem here is that on the 2nd line $(this).val()
is the same as $('#close_thoughts').val()
and you're looking for $('.thoughts_list').val()
.