I am looking to dynamically change the background color by selecting RGB values in a color picker, without needing to click on a button to apply the change. I want the background color to update in real-time as I adjust the color picker.
function autoChangeColor(){
let selectedColor = document.getElementById('colorpicker').value;
document.body.style.backgroundColor = selectedColor;
}
<input id = "colorpicker" type = "color">
<button onclick = "autoChangeColor();"> change Color </button>