checked checkboxes and radio button with jquery
checked checkboxes and radio button with jquery
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<div>
<albel><input id="checkbox" type="checkbox"><img src="http://science-all.com/images/wallpapers/smile-images/smile-images-16.jpg" id="img" alt="Smiley face" width="42" height="42"></albel>
</div>
<div>
<albel><input id="radio" type="radio" ><img src="http://science-all.com/images/wallpapers/smile-images/smile-images-16.jpg" id="img1" alt="Smiley face" width="42" height="42"></albel>
</div>
JavaScript
// Check #checkbox , #radio
$("#img").click(function(){
$( "#checkbox" ).prop( "checked", true );
});
$("#img1").click(function(){
$( "#checkbox" ).prop( "checked", true );
});
// Uncheck #checkbox , #radio
/*
$( "#checkbox" ).prop( "checked", false );
$( "#radio" ).prop( "checked", false );
*/