복제 된 jQuery 객체로 div 컨텐츠 내의 각 id 속성에 대한 증가 값을 추가하는 방법을 파악하는 데 어려움이 있습니다.복제 된 jQuery 객체를 사용하여 div 컨텐츠 내의 각 id 속성에 증분 값을 추가하는 방법
===================== HTML =================== ==
<div class="upload-file-container">
<div class="uploadFile left clearfix">
<input type="file" id="FileUpload1">
<table id="RadioButtonList1">
<tbody>
<tr>
<td><input type="radio" value="Resume" id="RadioButtonList1_1">
<label for="RadioButtonList1_1">Resume</label></td>
<td><input type="radio" value="Letter of Recommendation" id="RadioButtonList1_2">
<label for="RadioButtonList1_2">Letter of Recommendation</label></td>
<td><input type="radio" value="Other" id="RadioButtonList1_3">
<label for="RadioButtonList1_3">Other</label></td>
</tr>
</tbody>
</table>
</div>
<a href="javascript:;" class="remove left">Remove</a> </div>
<div class=""><a class="plus" href="javascript:;">plus one</a></div>
=====================의 JQUERY =================== == 대신 번호가 ID를 사용
//Cloning upload file control
$('.remove').live('click', function() {
if (confirm("Are you sure you wish to remove this item?")) {
$(this).parent().slideUp('fast', function() {
$(this).remove();
});
}
return false;
});
$('.plus').click(function() {
console.log('cloning');
var divCloned = $('.upload-file-container:first').clone();
divCloned.hide().insertAfter('.upload-file-container:last').slideDown('fast');
return false;
});
많은 코드처럼 보이지 않습니다. 여기에 게시하고 바이올린 링크를 참조로 사용하는 것이 어떻습니까? jsfiddle이 폐쇄되면 어떨까요? 우리는 당신을 도울 수 없을 것입니다 :) – Lix
당신이 무엇을 묻고 있는지 분명하지 않습니다. – jfriend00
제게 당신이 왜 그것을 원하는지 분명하지 않습니다 - 예를 들어 name 속성이 없다는 것을 알아 두십시오. 불완전한가요? – Alexander