この動的HTMLブロックにスイッチ条件を含めるとします。どうやってやるの?動的HTMLブロックにスイッチケースを含める
editQuestionBlockHTML=' <div class="addQuestionBlock" >'
+'<div class="selectQnLabel"><p class="selectQnLabel">Select a type of question</p>'
+'<p class="questionTypes">';
switch(questionType)
{
case "Radio":
editQuestionBlockHTML += +' <select id="EditQuestionType" onchange="changeQuestionType();">'
+' <option value="radioBtn" selected="selected">Radio Button</option>'
+' <option value="checkBox">Check Box </option>'
+' <option value="pullDownMenu">Pull Down Menu</option>'
+' <option value="ratingScale"> Rating Scale</option>'
+' <option value="commentBox"> Comment Box</option>'
+' <option value="singleTextBox"> Single Text Box</option>'
+' </select>';
break;
}
editQuestionBlockHTML+=+'</p></div>'
+'<div style="float:left;width:100%;">'
+' <p class="selectQnLabel">Enter Question</p>'
+' <p><textarea "EditQuestionTitle-'+questionId+'" class="inputBox" rows="4" cols="65" >'+questionText+'</textarea></p>'
+'<div style="clear:both;">'
+'</div>'
+'</div>'
+'<div style="float:left;width:100%;">'
+' <p class="selectQnLabel">Enter Choices (Each choice on a separate line)</p>'
+' <p><textarea id="editQuestionChoiceList-'+questionId+'" class="inputBox" rows="4" cols="65">'
+choicelist
+'</textarea></p>'
+'<div style="clear:both;">'
+'</div>'
+'</div>'
+'</div>'
+'</div>';
return editQuestionBlockHTML;
あなたは、もう少し具体的な可能性があり、私は本当にあなたがやりたいん理解していない意味。 –