If a Check Box is Checked or Unchecked and we stored this value in Database, then How can we get that Value in JavaScript?
Here is my code:
<div class="editor-label" style="width: 110px;">
<%: Html.LabelForEx(model => model.SecurityVulnerability.SecurityVulnerability) %>
</div>
<div class="editor-field" style="width: 60px; padding-top: 0;">
<%: Html.CheckBoxFor(x => x.SecurityVulnerability.SecurityVulnerability) %>
</div>
Now If I loaded the page then check Box might be checked or not. If it is checked then I want to get this value as true(or whatever) or if not checked then false in JavaScript(I am writing some javaScript Function). I tried using onclick function but that only work when user do check and uncheck in UI Manually. Also if User clicks on UI manually then also I want to get value accordingly.
I am quite new to javaScript and razor.