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!!");
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn