3
我是jquery和html5的新手。如何使用jquery在輸入類型=範圍中更改輸入值,最小值和最大值?
我jQuery是:
var A_Route=['A1','A2','A3',.....'A50'];
var counter=0;
$("input[name='radio-choice']").change(function(){
if ($(this).val() == "on")
{
$('#slider').val(A_Route[counter]);
}
當我選擇其值爲ON的min和max值滑塊分別應該自動成爲A1和A50一個單選按鈕。當我滑動滑塊時,我的值應該從A1變爲A50。
我的HTML是:
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Layout view:</legend>
<input type="radio" name="radio-choice" id="radio-choice-c" value="on" checked="checked" />
<label for="radio-choice-c">List</label>
<input type="radio" name="radio-choice" id="radio-choice-d" value="off" />
<label for="radio-choice-d">Grid</label>
<input type="radio" name="radio-choice" id="radio-choice-e" value="other" />
<label for="radio-choice-e">Gallery</label>
</fieldset>
</div>
<div data-role="fieldcontain">
<label for="slider">Room:</label>
<input type="range" name="slider" id="slider" value="--------" min=? max=? data-highlight="true" />
</div>
您如何看待最小和最大的代碼應該是什麼?和 如何將輸入值從A1更改爲A50?
你答是正確的,但你改變的值。 – Newbie 2012-08-10 18:35:15