I have scenario where user provide color name. For that I first need to check user provided color name is valid or not using jquery.
For example user can provide val
You can use following method to validate css color
css('backgroundColor', 'white')backgroundColor using d.css('backgroundColor', this.value);$('#input').keyup(function() {
if (this.value.trim()) {
var d = $('')
.css('backgroundColor', 'white')
.css('backgroundColor', this.value);
$('#op').html(this.value + (d.css('backgroundColor') == '' && this.value + (d.css('backgroundColor') != 'white' && d.css('backgroundColor') != 'rgb(255, 255, 255)') || /^white$/i.test(this.value) ? ' is valid' : ' is not valid'));
} else
$('#op').empty();
});