![](/img/trans.png)
[英]How can I pass the value of a variable to a text area using JavaScript?
[英]How can I add text in text area after I push value using Jquery
當我選中復選框時,我會得到值以及如何添加默認文本值
$(document).ready(function() {
$('#email_getdata').click(function() {
var favorite = [];
$.each($("input[name='find_product']:checked"), function() {
favorite.push($(this).val());
});
$("#getdata_checked").html("ITEM : " + favorite.join(", "));
// I want to add text after I get value here
$( "$getdata_checked" ).after(function() {
$("#getdata_checked").html("rrr: ");
});
});
});
獲取項目值后,我想在文本區域中添加默認文本
我想顯示類似item1,item2
<- 我已經通過輸入檢查得到的東西
您可以使用$("#getdata_checked").html()
獲取內容,然后附加它..
$( "$getdata_checked" ).after(function() {
var content = $(this).html();
$("#getdata_checked").html("rrr: " + content);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.