1
A
回答
5
$(function() {
$("#myRadioId").prop("checked", true);
});
0
$(document).ready(function() {
$("#yourRadioButtonId").attr("checked", "checked");
//Or
$("#yourRadioButtonId").prop("checked",true);
});
1
這是那麼容易一派,最好的學習方法是嘗試一下你的自我。我們只有通過解決問題才能變得更好。
http://api.jquery.com/ready/
http://api.jquery.com/prop/
$(document).ready(function() {
$("#your id").prop("checked", true);
});
0
$(document).ready(function() {
$('radio-selector[name="the-value-to-set"]').attr('checked', 'checked');
});
相關問題
- 1. Radio Knob Slider(jQuery)
- 2. jquery check單選按鈕
- 3. jquery fields'form emptyness check
- 4. jQueryUI Radio/Check按鈕不會以編程方式更改
- 5. jquery check json data
- 6. jQuery check doctype
- 7. jQuery check .hasClass('[class * =「myclass-」]');
- 8. Jquery check複選框
- 9. jquery cookie check and set
- 10. javascript selected radio
- 11. GNU Radio中「工作」功能的輸入/輸出項目
- 12. jquery datepicker defaultDate php isset check
- 13. jquery check rel不會工作
- 14. jquery check-uncheck複選框
- 15. jQuery限制「Dropdown Check List」選擇
- 16. jQuery IF和'Radio'的價值問題
- 17. Ionic AngularJS Radio Group ng-model issue using ion-radio
- 18. CheckedListBox和Check Listener
- 19. Check Check從arrayadapter獲取
- 20. Jquery check multiple選擇具有值集
- 21. 待辦事項的jQuery,劃掉項目
- 22. GNU Radio和labview
- 23. Radio Button Struts 1.3
- 24. Streaming Radio mp3
- 25. ReactNative和NativeBase Radio
- 26. Swift Radio Streaming AVPlayer
- 27. CakePHP Radio Buttons
- 28. JSF datatable,tomahawk radio
- 29. javascript in radio button
- 30. Google check out error
參閱http://stackoverflow.com/questions/871063/how-to-set-radio-option-checked-onload-with-jquery – 2012-01-03 11:51:55