Tuesday, August 27, 2019

Checkbox onchange event jquery

<html>
<head>
<title>Checkbox onchange event using jquery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(function(){
$("#chkCheck").change(function(){
  if ($(this).is(':checked')) {
$("#txtContent").html("Checkbox Checked!");
} else {
$("#txtContent").html("Checkbox Unchecked!");
}
});
});
</script>
</head>
<body>
<div style='padding:2rem;text-align:center;'>
Check on the Check box <input type="checkbox" id="chkCheck"/>
<br>
<label id="txtContent" style="color:green;"></label>
</div>
</body>
</html>


Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...