In JavaScript using jQuery, how does one test whether the color assigned to an element is red blue, having an id as \'ID\'.
id
\'ID\'
The JavaScript stat
You should be able to check this with the css function with only one argument:
css
if ($('#ID').css('background-color') == '#FF0000') { // your code }
My preference would be to add a class (red or blue) and check using hasClass:
red
blue
hasClass
if ($('#ID').hasClass('red')) { // your code }