If I insert some html via js after the doc.ready than checked='checked' radio button doesn't render as checked in Google Chrome
also, I noticed that if I remove the name attribute from the input than it works
here is the whole thing:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"
type="text/javascript"></script>
</head>
<body>
<script type='text/javascript'>
$(function(){
$('body').append('<input type="radio" checked="checked" value="33" name="whatever" id="aeHobby0">');
});
</script>
</body>
</html>
The checked property sets or returns the checked state of a radio button. This property reflects the HTML checked attribute.
You can check a radio button by default by adding the checked HTML attribute to the <input> element. You can disable a radio button by adding the disabled HTML attribute to both the <label> and the <input> .
We can check the status of a radio button by using the :checked jQuery selector together with the jQuery function is . For example: $('#el').is(':checked') . It is exactly the same method we use to check when a checkbox is checked using jQuery.
It would appear to be a bug in 1.4.4 (live copy). It works fine in 1.6.2 (live copy). Looks like it was fixed between 1.5.2 and 1.6.0 (at least in my tests), which suggests it was probably fixed by the patch that fixed bugs 8060 and 8500.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With