JSFiddle - React, Tailwind, and code Playground
by Dineshkani
HTML
<input type="checkbox" checked="checked" value="Example"> Example
CSS
.sample{
font-size: 35px;
color: blue;
position: relative;
height: 80px;
}
JavaScript
//In Jquery
$("input").click(function(){
alert($(this).prop('checked'));
alert($(this).attr('checked'));
});
//In prop method it return the boolean datatype of the checked attribute
//But in attr() method it returns the string present in it.