我是 jquery 的新手,有一个问题....也许你能帮忙...
<select name="prodName[]" class="select-head" id="prodName0">
<option value="">Select Product</option>
<option value="add_prod">Add New</option>
<-- Here i have db select query --><option value=" "></option></select>
我的 jquery 作为
$(".select-head").live('change',function() {
if($(this).val() != "") {
$(this).next().val($(this).val());
}
});
最佳答案
$(".select-head").on('change',function () {
var selText = $(this).find('option:selected').text(); //.val() for value
$('.textarea').val(selText);
});
关于javascript - 如何在 jquery 中使用下拉列表在 <td> 中插入 textarea 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12092870/