This is my JavaScript, using jQuery:
$("#E_DIV_H input[value='E,F']").attr('checked', 'checked');
var data = $('#E_DIV_H').html();
$('#copy').html(data);
When it copies the data from one <div>
(#E_DIV_H
) to another DIV (#copy
), it unchecks the check box, which should already be checked due to the following code!
$("#E_DIV_H input[value='E,F']").attr('checked', 'checked');
Using Firebug, I see that .attr('checked', 'checked')
is checking the check box without adding the attribute.
Is there any solution that works cross-browser? I’m using jQuery 1.4.2.