Let’s say you have a checkbox with the name ‘MyCheckBox”. Using JQuery, here’s a function you can use to be able to tell whether or not it’s checked:
$(document).ready(function () {
$("#MyCheckBox").click(function () {
var chk=this.checked;
if (chk==true)
{alert("Mycheckbox is checked");}
else
{alert("Mycheckbox is NOT checked");}
});
});
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF
Leave a reply
You must be logged in to post a comment.