<button class="color" id="red" name="button" value="red" onclick='change_color(this.value)'>red</button>
<button class="color" id="orange" name="button" value="orange" onclick='change_color(this.value)'>orange</button>
function change_color(color) {
if(color) {
document.body.style.backgroundColor = color;
window.localStorage.setItem('bgColor', color);
}
}
window.addEventListener('DOMContentLoaded', change_color.bind(null, window.localStorage.getItem('bgColor')));