Reputation: 96790
I've tried select();
check();
and even .selected = true;
but I still haven't gotten around to selecting that radio button. Is there any way I can accomplish this?
Upvotes: 2
Views: 332
Reputation: 741
Maybe you could post your code and we could give you a more complete solution?
To check a radio button I'm pretty sure it's .checked = true;
Upvotes: 1
Reputation: 16190
<input type=radio id='r'>
<script>
document.getElementById('r').checked=true;
</script>
Use .checked
Upvotes: 4
Reputation: 816272
You have to use the checked
property:
element.checked = true;
Reference: HTMLInputElement
Upvotes: 6