重複の可能性:
Jquery get .val
この質問を修正しました。私が必要としているのは、
( $(this).attr("value"));
の「これ」に現れる
$("#activities_" +btn_id).val($(this).val());
これがコードです。
$('.thoughts_list').click(function(){
( $(this).attr('id'));
( $(this).attr("value"));
});
$('#close_thoughts').click(function(){
$("#activities_" +btn_id).val($(this).val());
});
現在、返される値は「キャンセル」です。これは「#close_thoughts」の値ですが、代わりにクリックされた「.thoughtslist」の値が必要です。