JSFiddle - React, Tailwind, and code Playground
by Zaheer Ahmed
HTML
<input type="checkbox" checked id="myCheckBox">My Checkbox</input>
<br/>
<br/>
<input type="button" value="Check Property Now" />
JavaScript
$('input[type="button"]').click(function () {
console.log('using attr() :'+$('#myCheckBox').attr('checked'));
if ($('#myCheckBox').prop('checked')) {
//change it to alert('Its Checked'); if you not working with console
console.log('Its Checked');
} else {
console.log('No its not Checked');
}
});