Skip to content
Permalink
702ac2a3e1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
43 lines (31 sloc) 777 Bytes
<html>
<body>
<p>Color Picker</p>
<form id="color-picker">
<input type="color" id="page" name="page">
</form>
<script>
let picker = document.getElementById('page');
let body = document.querySelector('body');
const colorPicker = 'color-picker';
let allItems = JSON.parse( localStorage.getItem(colorPicker) );
picker.addEventListener('change', function(event) {
let.hex = this.value;
})
function updateFirst(event) {
var body = document.querySelector("body");
if (body) {
body.style.color = event.target.value;
}
}
function updateAll(event) {
document.querySelectorAll("body").forEach(function(body) {
body.style.color = event.target.value;
});
}
function storeColor() {
localStorage.setItem(colorPicker);
}
</script>
</body>
</html>