Monday 9 December 2019

color picker

Color Picker

With HTML5, there are some really interactive customizations that visitors to your website will like. The color picker will need a little JavaScript coding and CSS to let you choose what color you want from a palette rather than having to enter an abstract color code. This feature will be particularly user-friendly for those new to coding or without a lot of coding knowledge.
The code can be something like this:
<!--HTML--> Choose a color to color the below text <input 
id="color_picker" type="color" 
nchange="showHex();"> <span id="color_hex_value"></span> 
<h1>COLOR ME !</h1> <!--CSS--> body {
    font-family: "bookman old style";
}
<!--JS--> function showHex() {
    var hex document.querySelector("#color_hex_value"),
 h1 document.querySelector("h1");
    h1.style.color document.querySelector("#color_picker").value;
}

No comments:

Post a Comment