我需要使用 JQM 随机呈现输入。
我想我应该使用 div 来分隔每个问题,然后调用 JavaScrip func 进行排序,但不知道如何进入。
Q1、Q3、Q2 ... Q1、Q2、Q3 ... Q3、Q2、Q1 ... ETC
像这样:
Q1. What is your age? (Number)
Q2. What color do you prefer? (Single choice)
Q2. Tell us about the food...(Group)
这是标记:
<div>
<h4>Q1. What is your age?</h4>
</div>
<input name='V14' id='V14' data-default-value='0' type='number' min='0' max='100' size='12' step='0.1' class=''/>
<div>
<h4>Q2. What color do you prefer</h4>
</div>
<fieldset data-role='controlgroup' id='V15'>
<input id ='V15_1' type='radio' name='V15' value='1'><label for='V15_1'> Blue</label>
<input id ='V15_2' type='radio' name='V15' value='2'><label for='V15_2'> Red</label>
<input id ='V15_3' type='radio' name='V15' value='3'><label for='V15_3'> Yellow</label>
</fieldset>
<div>
<h4>Q3. Tell us about the food</h4>
</div>
<div data-role='collapsible-set'>
<div data-role='collapsible' data-collapsed='false' data-theme='b' data-content-theme='d'>
<h3>Flavour</h3>
<fieldset data-role='controlgroup' id='V16'>
<input id ='V16_1' type='radio' name='V16' value='1'><label for='V16_1'> Good</label>
<input id ='V16_2' type='radio' name='V16' value='2'><label for='V16_2'> Fair</label>
</fieldset>
</div>
</div>
<div data-role='collapsible-set'>
<div data-role='collapsible' data-collapsed='false' data-theme='b' data-content-theme='d'>
<h3>Taste</h3>
<fieldset data-role='controlgroup' id='V17'>
<input id ='V17_1' type='radio' name='V17' value='1'><label for='V17_1'> Good</label>
<input id ='V17_2' type='radio' name='V17' value='2'><label for='V17_2'> Fair</label>
</fieldset>
</div>
</div>
<div data-role='collapsible-set'>
<div data-role='collapsible' data-collapsed='false' data-theme='b' data-content-theme='d'>
<h3>Temperature</h3>
<fieldset data-role='controlgroup' id='V18'>
<input id ='V18_1' type='radio' name='V18' value='1'><label for='V18_1'> Good</label>
<input id ='V18_2' type='radio' name='V18' value='2'><label for='V18_2'> Fair</label>
</fieldset>
</div>
</div>