change() is populated twice in IE8

by drublic

HTML

<p id="desc">The checkbox is clicked: The onchange-listener gets populated twice in IE8.</p>
<div id="population"></div>

CSS

#desc { font-size: 1.3em; margin-bottom: 20px; }

JavaScript

var $input, _output;
$input = $( '<input />', { 'type' : 'checkbox' }).change( function() {
    if ( $( this ).is( ':checked' ) ) {
        _output = "Checked";
    } else {
        _output = "Unchecked";
    }
    $( '#population' ).append( '<p>' + _output + '</p>' );
}).insertAfter( '#desc' );