이 바이올린을 실행할 때마다 참조 오류가 발생합니다.버튼 클릭시 컨텐츠 추가
이 함수는 양식에 다른 라디오 버튼을 추가해야합니다.
도움이 될 것입니다.
감사
https://jsfiddle.net/RyeManship/2jtvjd28/
HTML
<section class="content">
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
<input type="text" class="form-control" placeholder="Type Question Here">
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
<input type="text" class="form-control" placeholder="Type Question Here">
</label>
</div>
</section>
<div class="row">
<button type="button" class="btn btn-success" onclick="javascript:AddQuestion()">Add</button>
<button type="button" class="btn btn-danger">Remove</button>
<button type="button" class="btn btn-info">Submit Question</button>
</div>
자바 스크립트
function AddQuestion() {
$(".content").append('<div class="radio"><label><input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked><input type="text" class="form-control" placeholder="Type Question Here"></label></div>');
};
안녕하세요, 그냥 자바 스크립트 옵션에서 변경 : 이미 jQuery를 사용하는 것처럼, 여기에 당신이 할 수있는 방법 머리가 감싸지 않아야 함) : https://jsfiddle.net/2jtvjd28/2/ – briosheje
https://jsfiddle.net/2jtvjd28/3/ 'Load' 대신'
'에 코드를 추가하기 만하면됩니다. –