Then, access the checked property of the checkbox element. There is no required value for the checked attribute. the HTML is used to define a checkbox field. Examples might be simplified to improve reading and learning. Checkbox CSS Example #1. The Html.CheckBox helper takes a string that is used to render the name and id attributes of the input element: @Html.CheckBox("IsChecked") There are overloads that enable you to set the checkbox as checked, and to provide additional arbitrary attributes: @Html.CheckBox("IsChecked", new { @class = "form-control" }) Sets or returns the checked state of a checkbox. You can copy this code and add it to your projects. checked The purpose of the HTML checked attribute is to define whether a checkbox or a radio button is checked (i.e. A checkbox is a form element that allows the user to select multiple options from a range of options. The checked attribute can also be set after the page load, with a JavaScript. The checkbox is shown as a square box that is ticked when it is activated. The checked attribute is a boolean attribute. Checkboxes are created with the HTML tag. In that regard, the checkbox works opposite of a radio button, which only allows you to select one item from a group of choices. It only carries true and false value for the checked and unchecked item. Quick Reach 1 HTML Checkbox 1.1 Basic syntax of creating a checkbox 2 HTML single checkbox example with script 3 checkbox checked example 4 Using multiple checkboxes in a group HTML Checkbox The HTML checkbox is way to allow users … Set the position to "relative". In pure JavaScript, you can use the checked property to get the checked state of a checkbox. document.getElementById("myCheck").checked = false; } Try it Yourself ». The :checked CSS pseudo-class selector represents any radio (), checkbox (), or option (