Providing a default color

by Md. Atiquzzaman Soikat

HTML

<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color -->

<input id="picker" type="color" value="#ff0000">

JavaScript

document.getElementById('picker').addEventListener('change', function(e){
	console.log(e.target.value);
})