For versions of jQuery equal or above (>=) 1.6, use:
$("#radio_1").prop("checked", true);
For versions prior to (<) 1.6, use:
$("#radio_1").attr('checked', 'checked');
Tip: You may also want to call click()
or change()
on the radio button afterwards. See comments for more info.
Related Contents:
- How can I know which radio button is selected via jQuery?
- How to uncheck a radio button?
- In jQuery, how do I select an element by its name attribute?
- jQuery $(“#radioButton”).change(…) not firing during de-selection
- By event.target, how I know that it is checkbox or it is radio?
- Bootstrap radio-buttons toggle issue
- jQuery check/uncheck radio button onclick
- Download a file by jQuery.Ajax
- Print the contents of a DIV
- How is AngularJS different from jQuery
- Remove everything after a certain character
- Detect the Enter key in a text input field
- How to disable all div content
- Only detect click event on pseudo-element
- Prevent browser from loading a drag-and-dropped file
- jQuery.parseJSON throws “Invalid JSON” error due to escaped single quote in JSON
- Detect if a page has a vertical scrollbar?
- jQuery see if any or no checkboxes are selected
- Why is this jQuery click function not working?
- What is the difference between jQuery version 1, version 2, and version 3? [closed]
- Using jquery to get element’s position relative to viewport
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Generic way to detect if html form is edited
- Download a div in a HTML page as pdf using javascript
- Best Practice to Organize Javascript Library & CSS Folder Structure [closed]
- Image convert to Base64
- How can I remove the “No file chosen” tooltip from a file input in Chrome?
- Using jQuery’s ajax method to retrieve images as a blob
- jQuery – hashchange event
- Child element click event trigger the parent click event
- Abort new AJAX request before completing the previous one
- jQuery getJSON save result into variable [duplicate]
- jQuery/JavaScript collision detection
- jQuery select a div with a certain class, that doesn’t have another class
- is it possible to open a popup with javascript and then detect when the user closes it?
- Pure css close button
- What are some empirical technical reasons not to use jQuery? [closed]
- ng-mouseover and leave to toggle item using mouse in angularjs
- Dynamically change bootstrap progress bar value when checkboxes checked
- Ellipsis in the middle of a text (Mac style)
- JavaScript – head, body or jQuery?
- Uncaught Error: Cannot find module ‘jquery’
- How to format/tidy/beautify in JavaScript
- jQuery plugin template – best practice, convention, performance and memory impact
- Chrome Extension “Refused to load the script because it violates the following Content Security Policy directive”
- Open a new tab with custom HTML instead of a URL
- Debugging scripts added via jQuery getScript function
- Get data-attribute jquery vs javascript
- How to wait until jQuery ajax request finishes in a loop?
- Variables set during $.getJSON function only accessible within function