JSFiddle - React, Tailwind, and code Playground
HTML
<label class="checkbox">
<input type="checkbox" class="hide" value="new-window" />
в новом окне
</label>
CSS
.checkbox {
display: block;
height: 13px;
padding-left: 19px;
font-size: 11px;
cursor: pointer;
background: transparent url('http://savepic.net/2576510.png') no-repeat;
}
.checkbox.unchecked {
background-position: 0 -13px;
}
.hide {
display: none;
}
JavaScript
$('.checkbox').click(function() {
if ( $(this).children('[type="checkbox"]').attr('checked') ){
$(this).children('[type="checkbox"]').removeAttr('checked');
$(this).removeClass('unchecked');
} else {
$(this).children('[type="checkbox"]').attr('checked','checked');
$(this).addClass('unchecked');
}
return false;
});