少しのphpでそれを行うことができます:
<input type="checkbox" name="one" value="one" id="one" <?= ($_GET["one"] == "checked" : "checked" : "" ?> >
<input type="checkbox" name="two" value="two" id="two" <?= ($_GET["two"] == "checked" : "checked='checked'" : "" ?>>
.... または、あなたが言及したように、Javascript を使用したクライアント側で:
document.body.onload = function() {
var hash = window.location.hash().substr(1);
var parts = hash.split("&");
for(var i = 0; i < parts.length; i++) {
var variable = parts.split("=");
if(variable[0] == "one") // if the key of a get-variable equals "one"
document.getElementById("one").setAttribute("checked");
else if(variable[0] == "two") // if the key of a get-variable equals "two"
document.getElementById("two").setAttribute("checked");
}
};
それが役立つことを願っています...