一、点击事件和获取颜色值
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body style=" background: rgb(238, 255, 255);"> <input type="color" id="onchange"> </body> <script type="text/javascript"> document.getElementById(\'onchange\').onchange = function(){ document.getElementById(\'onchange\').click(); document.body.style.background = this.value; }; </script> </html>