Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
problems
  • Loading branch information
met18001 committed Feb 5, 2020
1 parent 0627cd5 commit a6318f6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions week-2/color_picker.html
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Color Picker</title>
</head>
<body>

<form>
<input type="color" id="head" name="head">
</form>


<script>
let picker = document.getElementById('head');
let body = document.querySelector('body');



picker.addEventListener('change', function(event){
let hex = this.value;
body.style.backgroundColor = hex;
})





</script>
</body>
</html>

0 comments on commit a6318f6

Please sign in to comment.