jquery dynamically added checkbox .attr("checked",true) not working
<p>Based on some data I'm cloning a div with a checkbox and check it if the data value is "True" then append to a target div.</p>

<p>using jquery 1.5.2</p>

<p>IE8 works in compatibility mode, doesn't work otherwise.
FF doesn't work.</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="scripts/jquery-1.5.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        $(function () {          
            // test data
            var data = [{ "CB": "True" }, { "CB": "False"}];

            var theClone = $("#clone").clone(true);
            var temp = "";

            if (data !== null) {
                $.each(data, function (i, d) {
                    var cb = theClone.find('.cbClass');

                    if (d.CB === "True") { 
                        //cb.attr("checked","checked"); //doesn't work
                        //cb.val(true); //doesn't work
                        //cb.attr("checked", true); //doesn't work

                    }

                    temp += theClone.html();
                });
            }
            $("#target").append(temp);    
        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="target"&gt;
    &lt;div id="clone" class="cloneClass" style="display:none"&gt;
    &lt;div class="container"&gt;
        &lt;input type="checkbox" class="cbClass" /&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
