I am used to doing this in jQuery
$('#RememberMe').attr('checked', true);
but I can’t remember how to do it in Javascript I thought that
document.getElementById("RememberMe").value = "True";
would work, but it doesn’t, it changes the value but does not create the visual check on the html.
I am trying to set the checkbox to on by default. here is the html
<input id="RememberMe" name="RememberMe" type="checkbox" value="false" />
To change checkbox state try this:
If you need to change the value of checkbox as an
inputelement use:However, you can set default value and state in HTML markup: