我想用新值替换名称属性的一部分。该值取决于原始值。 name属性的数值为:时隙[timeslot_1] [开始]替换jQuery中表单元素属性的一部分
如何增加价值“timeslot_1”到“timeslot_2”,并与这一个替换原来的价值?
cloneElm由两种类型的元素(输入和选择)组成 - 我希望能够捕获我的循环中的两个元素。
的代码,我到目前为止有:
$(cloneElm).children('span').children('input').each(function(id) {
var newName = $(this).attr('name').replace('timeslot_1', 'timeslot_2');
$(this).attr('name', newName);
});
感谢