如何让新元素(如新的单选按钮)包含onchange函数事件 就我而言
$('input[type=radio]').onchange(function(){
$(`:radio[name=${this.name}]`).val($(this).attr("logic"));
});
仅用于准备文档,但单击#btnAddRow按钮时,新行中的新单选按钮不可用
$(document).ready(function () {
$('#btnAddRow').click(function(){
var loop_length=$('.loop_length').last().text()
var $lastRow = $("tr:last"); //grab row before the last row
var $newRow = $lastRow.clone(); //clone it
$newRow.find(":text").val(""); //clear out textbox values
$newRow.find(".td_id_span").text(""); //clear out textbox values
$newRow.find(".td_btnRuleDelete_btn").remove()
$newRow.find("input[type=radio]").prop("name", 'Logic_'+(parseInt(loop_length)+1));
$lastRow.after($newRow); //add in the new row at the end
})
$('input[type=radio]').onchange(function(){
$(`:radio[name=${this.name}]`).val($(this).attr("logic"));
});
})