<form>
<input type="color" value="" id="favcolor">
</form>
<input id="hex">
<script>
var theInput = document.getElementById("favcolor");
var theColor = theInput.value;
theInput.addEventListener("input", function() {
document.getElementById("hex").innerHTML = theInput.value;
});
</script>
innerHTML
document.getElementById("hex").innerHTML = theInput.value;
value
document.getElementById("hex").value = theInput.value;
input