If div is clicked, html5 color inputs values should set to clicked div color and background color values.
I tried code
$(function() {
$("#changeMe").on('click', function() {
$('#designer-javascript-color').val($(this).css("color"));
$('#designer-javascript-backcolor').val($(this).css("background-color"));
});
});
Selected item color:
<input type="color" id="designer-javascript-color" />
<br>Selected item background color:
<input type="color" id="designer-javascript-backcolor" />
<br/>
<div id="changeMe" style='color:white;background-color: blue'>
click here</div>
After clicking in click me both inputs have still black colors. How to fix this so that white and blue colors apper in inputs ?
Testcase is at http://jsfiddle.net/bpc2w43w/