我想通过js onload indde.ut最小值更改。
我正在尝试此代码,但无法正常工作。
<script type="text/javascript">$(document).ready(function(){
$("#quantity_5c27c535d66fc").min('10');
});</script>
我的输入代码;
<input type="number" id="quantity_5c27c535d66fc" class="input-text qty text" step="10" min="1" max="" name="quantity" value="1" title="Miktar" size="4" pattern="[0-9]*" inputmode="numeric" aria-labelledby="">
最小值更改等5
答案 0 :(得分:2)
尝试一下:
<script type="text/javascript">
$(document).ready(function(){
$("#quantity_5c27c535d66fc").min=10;
});
</script>
我希望这会有所帮助!
答案 1 :(得分:2)
对我来说,可行的解决方案是:
$(document).ready(function() {
$('#quantity_5c27c535d66fc').attr({
'min': 2,
});
});
jQuery在这里使用attr
函数,使用了一些不同的方法。