Skip to content
Permalink
019661fb89
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
29 lines (21 sloc) 743 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Background Changer</title>
</head>
<body>
<input type="color" id="colorPickerButton" name="color">
<script>
let colorPicker = document.querySelector("input");
colorPicker.addEventListener("change", function() { //change event
document.body.style.backgroundColor = this.value;
});
colorPicker.addEventListener("input", function() { //input event
document.body.style.backgroundColor = this.value;
});
</script>
</body>
</html>