Jquery get .val

后端 未结 3 726
暗喜
暗喜 2021-01-26 13:22

What I need is the \"this\" value of

( $(this).attr(\"value\")); 

to show up in the \"this\" of

$(\"#activities_\" +btn_id).val         


        
3条回答
  •  有刺的猬
    2021-01-26 14:05

    This perhaps?

    $('.thoughts_list').on('click', function() {
        $("#activities_" + this.id).val(this.value);
    });
    

    Your question is quite cryptic. Are you trying to change the value for the element with an ID of activities_ + the ID of the clicking element? If so, the above will work. If not, you need to elucidate your situation a bit more.

提交回复
热议问题