I have many of these multiple choice selections in a control panel, and I wish to get the data entered into the text fields using JQuery. Preferably the format would be Question, AnswerOpt1, AnswerOpt2.... I have tried the code supplied below, and some variations of it, but have been unsuccessful.
HTML
<div class="formRow">
<label>Multiple Choice: </label>
<div class="formRight">
Question: <input type="text" class="MCQuestion" />
</div>
<div class="formRight MCAns">
Answer Option1: <input type="text" class="MCAnswer"/>
</div>
<div class="formRight MCAns">
Answer Option2: <input type="text" class="MCAnswer"/>
</div>
</div>
<div><a href="#" id="Save">Save</a></div>
<div id="log"></div>
Javascript
$("#Save").on("click",function() {
$(".MCQuestion").each(function(){
if($(this).val()!=""){
$(this).parent().find(".MCAnswer").each(function(){
$('#log').after($(this).val());
});
}
});
return false;
});