I’ve noticed that Mozilla’s refresh doesn’t bring the page to a blank slate. I have checkboxes on the form that I need to be unchecked when the page is loaded/refreshed. Currently I am using this:
<body onLoad="uncheck()">
function uncheck() {
// Uncheck all checkboxes on page load
$("input:checkbox:checked").attr("checked", "");
console.log("uncheck");
}
This works for loading the page completely, but if i click refresh (in Mozilla) the function is called properly because “uncheck” is being printed to the console, but the checkboxes are remaining checked.
Any thoughts?
Use prop instead:
or removeAttr: