Tôi có điều này nút radio trong mã html:phép lĩnh vực đầu vào nếu nút radio được kiểm tra với jquery
<span><input type="radio" value="false" name="item[shipping]" id="item_shipping_false" checked="checked"><label for="item_shipping_false" class="collection_radio_buttons">No</label></span>
<span><input type="radio" value="true" name="item[shipping]" id="item_shipping_true"><label for="item_shipping_true" class="collection_radio_buttons">Yes</label></span>
và tôi có 1 lĩnh vực khuyết tật như:
<input id="item_shipping_cost" class="currency optional" type="text" size="30" name="item[shipping_cost]" disabled="disabled">
Tôi muốn rằng nếu một người sử dụng nhấp vào tùy chọn Có trong nút radio, xóa thuộc tính html disabled="disabled"
thành trường nhập cuối cùng này và nếu người dùng nhấp vào tùy chọn Số trong nút radio thêm thuộc tính disabled="disabled"
đến trường nhập cuối cùng này
Tôi có thể làm điều đó bằng jquery như thế nào?
cảm ơn bạn!
Cảm ơn bạn cho mã javascript này hoạt động tốt: D – hyperrjas