 <pre><code>function doTheStuff(a, b) { var bookstorname = localStorage.getItem(a) if (bookstorname == 1) { document.getElementById(b).setAttribute('checked','checked'); } if (bookstorname == 0) { document.getElementById(b).removeAttribute('checked','checked'); } } window.onload = function Equal() { doTheStuff('b1', 'box1'); doTheStuff('b2', 'box2'); } </code></pre> <p>?</p>