<form>
<div class="attribute_value back">
<input name="id[4]" type="hidden" id="attrib-4" />
<div id="tips_4" class="tips"></div>
<ul id="list_4" class="list_attribute">
<li id="value_50" class="list_name_id_4" rel="50"><span id="valule_text_50">100</span></li>
<li id="value_11" class="list_name_id_4" rel="11"><span id="valule_text_11">48</span></li>
<li id="value_12" class="list_name_id_4" rel="12"><span id="valule_text_12">50</span></li>
<li id="value_13" class="list_name_id_4" rel="13"><span id="valule_text_13">52</span></li>
<li id="value_14" class="list_name_id_4" rel="14"><span id="valule_text_14">54</span></li>
<li id="value_28" class="list_name_id_4" rel="28"><span id="valule_text_28">56</span></li>
<li id="value_29" class="list_name_id_4" rel="29"><span id="valule_text_29">58</span></li>
<li id="value_30" class="list_name_id_4" rel="30"><span id="valule_text_30">60</span></li>
<li id="value_31" class="list_name_id_4" rel="31"><span id="valule_text_31">62</span></li>
<li id="value_32" class="list_name_id_4" rel="32"><span id="valule_text_32">64</span></li>
<li id="value_33" class="list_name_id_4" rel="33"><span id="valule_text_33">66</span></li>
<li id="value_34" class="list_name_id_4" rel="34"><span id="valule_text_34">68</span></li>
<li id="value_35" class="list_name_id_4" rel="35"><span id="valule_text_35">70</span></li>
<li id="value_36" class="list_name_id_4" rel="36"><span id="valule_text_36">72</span></li>
<li id="value_37" class="list_name_id_4" rel="37"><span id="valule_text_37">74</span></li>
<li id="value_38" class="list_name_id_4" rel="38"><span id="valule_text_38">76</span></li>
<li id="value_39" class="list_name_id_4" rel="39"><span id="valule_text_39">78</span></li>
<li id="value_40" class="list_name_id_4" rel="40"><span id="valule_text_40">80</span></li>
<li id="value_41" class="list_name_id_4" rel="41"><span id="valule_text_41">82</span></li>
<li id="value_42" class="list_name_id_4" rel="42"><span id="valule_text_42">84</span></li>
<li id="value_43" class="list_name_id_4" rel="43"><span id="valule_text_43">86</span></li>
<li id="value_44" class="list_name_id_4" rel="44"><span id="valule_text_44">88</span></li>
<li id="value_45" class="list_name_id_4" rel="45"><span id="valule_text_45">90</span></li>
<li id="value_46" class="list_name_id_4" rel="46"><span id="valule_text_46">92</span></li>
<li id="value_47" class="list_name_id_4" rel="47"><span id="valule_text_47">94</span></li>
<li id="value_48" class="list_name_id_4" rel="48"><span id="valule_text_48">96</span></li>
<li id="value_49" class="list_name_id_4" rel="49"><span id="valule_text_49">98</span></li>
</ul>
</div>
<br class="clearBoth" />
</div>
<input type="submit" value="add to cart" alt="Add to Cart" title=" Add to Cart " id="cartbutton" class="btnAddToCart" align="absmiddle" />
</form>
请问大侠们,要是上面li没有选择的话,你们input的submit 就是disabled状态,当有选择的话,就取消disabled状态,这样的JQ要如何写哦?
<script type="text/javascript">
$(document).ready(function() {
// body...
$('.list_name_id_4').click(function(){
var submit = $('#cartbutton');
submit.attr('disabled',false);
})
});
</script>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。