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 doctype
- 6. jquery cookie check and set
- 7. GNU Radio中「工作」功能的輸入/輸出項目
- 8. jquery check-uncheck複選框
- 9. jquery check rel不會工作
- 10. jQuery限制「Dropdown Check List」選擇
- 11. jQuery IF和'Radio'的價值問題
- 12. Ionic AngularJS Radio Group ng-model issue using ion-radio
- 13. CheckedListBox和Check Listener
- 14. Check Check從arrayadapter獲取
- 15. Jquery check multiple選擇具有值集
- 16. jQuery中的ContextMenu項目
- 17. Swift Radio Streaming AVPlayer
- 18. ReactNative和NativeBase Radio
- 19. CakePHP Radio Buttons
- 20. javascript in radio button
- 21. GNU Radio和labview
- 22. Google check out error
- 23. Javascript Radio add value Textarea
- 24. 甲骨文插入使用check選項
- 25. gcc選項-fstack-check如何工作?
- 26. jQuery添加項目
- 27. 項目的jquery樹
- 28. Jquery Draggable多項目
- 29. StrcutureMap Wiring - Sanity Check請
- 30. PHP check array
參閱http://stackoverflow.com/questions/871063/how-to-set-radio-option-checked-onload-with-jquery – 2012-01-03 11:51:55