0
기존 div에 복제 div를 만들려고합니다. 클론이 작동하고 사용자가 버튼을 클릭하여 div를 복제 할 수 있습니다. 지금은의 메시지가 같은Jquery 복제 div 처음으로 6 회 이상 복제를위한 사용자 중지
<div id ="specdiv ">
<fieldset class="fieldset">
<legend class="legend">Question Specification</legend>
<div class="editor-label">
@Html.LabelFor(model => model.OfferedAnswer)
</div>
<div class ="answerchoice1" id="">
<div class="editor-field">
@Html.TextAreaFor(model => model.OfferedAnswer.AnswerText)
</div>
</div>
</fieldset>
</div>
<button id="quesId" class="mini-button" type =" button">+</button>
$(document).ready(function() {
$('button').click(function() {
//$('.answerchoice1').before($('.answerchoice1').clone())
var $target = $('.answerchoice1').find('div.editor-field:first');
$target.clone().appendTo('.answerchoice1');
var tID = $(this).attr(".answerchoice1").split(/ _/);
//console.log($('.example-1').html());
})
})
감사합니다. – cedPound