When using $("#id").attr("color") to get the color, ie and ff are different. Take a simple example:
Use $("#id").attr("color") to get the value "green" in ff and chrome, and in ie The value obtained is "#008000".
So, if you use attr("color") to determine the current color, considering compatibility, you need to determine the color name and the corresponding color code at the same time. For example:
if($("#id"). attr("color") == "green" || $("#id").attr("color") == "#008000" ){
alert("this color is green!!");
}