how to check if a color is valid in javascript

Solutions on MaxInterview for how to check if a color is valid in javascript by the best coders in the world

registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to check if a color is valid in javascript"
Jona
19 May 2017
1function isValidColor(strColor) {
2  var s = new Option().style;
3  s.color = strColor;
4
5  // return 'false' if color wasn't assigned
6  return s.color == strColor.toLowerCase();
7}
similar questions