jQuery - add text and var to value

前端 未结 4 1698
广开言路
广开言路 2021-01-28 09:39

I want to add normal text and a jQuery value to an input value.

var amount = $(\'option:selected\', this).val();
    $(\'.customfield\').val(\'clicks,

        
4条回答
  •  余生分开走
    2021-01-28 10:22

    var amount = $('option:selected').val(); // or var amount = $('#selectDropwdownId').val();
        $('.customfield').val("clicks,," + amount );
    

提交回复
热议问题