最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - checked="checked" not rendering as checked radio button in Chrome - Stack Overflow

programmeradmin1浏览0评论

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=".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>

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./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>
Share Improve this question edited May 10, 2018 at 14:01 Josh Lee 178k39 gold badges277 silver badges281 bronze badges asked Jul 26, 2011 at 13:48 OmuOmu 71.3k93 gold badges284 silver badges413 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

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.

发布评论

评论列表(0)

  1. 暂无评论