JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.1.min.js"></script>
<div id="attributs">
<input type="radio" id="1" value="1"/>
<label for="cb1"><img src=""/></label>
<input type="radio" id="2" value="2"/>
<label for="cb2"><img/></label>
<input type="radio" id="3" value="3"/>
<label for="cb3"><img/></label>
<input type="radio" id="4" value="4"/>
<label for="cb4"><img/></label>
<input type="radio" id="5" value="5"/>
<label for="cb5"><img/></label>
</div>
JavaScript
$('[type="radio"]').click(function () {
if ($(this).attr('checked')) {
$(this).removeAttr('checked');
$(this).prop('checked',false);
} else {
$(this).attr('checked', 'checked');
}
});