Fill in Input Field by Clicking Link with JQuery

前端 未结 3 488
予麋鹿
予麋鹿 2021-01-15 03:59

How might someone fill in an input field with some text using jquery by clicking that text?

The text is generated dynamically so the value is not know ahead of time.

3条回答
  •  滥情空心
    2021-01-15 04:34

    Try this:

    $(".special_field_link").click(function(){
     $("#a_input_id").val($(this).text());
    });
    

提交回复
热议问题