I recently implemented a colorPicker and now I want to extract the value from it and apply it.
Here is what I have used:
<li id="color"><input type="color" name="color" onchange="changeColor()"></li>
function changeColor(){
var selectedShapes = document.getElementsByClassName("selected");
var len = selectedShapes.length;
for(var i=0; i<len; ++i)
{
selectedShapes[i].style.background = document.getElementsByName("color");
}
}
The link to the file can be found here: http://jsbin.com/mebiriruzi/edit?css,js,output
Any suggestions on how to effectively utilize the user's selected color input?