How to get a value from HTML5 color picker
Try var color = $("#colorChoice").val();
See jQuery docs
You might as well bind your callback on the onChange event instead of the onClick event:
$("#colorChoice").change(function(){
$("h1").css('background', $(this).val());
});
Working sample
Don't use Jquery for this. vanillaJS works just fine
document.getElementById("colorChoice").value;
Your syntax is incorrect.
JavaScript:
var color = document.getElementById("colorChoice").value;
jQuery:
var color = $("#colorChoice").val();
I recommend using vanilla JS as it is faster than jQuery.