the different of IE and Chrome when return the color style
2013-10-05 15:46
411 查看
<style> div{ width:50px; height:50px; } </style> <script> function showColor(obj){ alert(obj.style.backgroundColor); } </script> <div id='a' style='background-color:red;' onclick='showColor(this)'></div> <div id='b' style='background-color:#eeeeff' onclick='showColor(this)'></div> <div id='c' style='background-color:rgb(1,11,111)' onclick='showColor(this)'></div>
source | IE | chrome |
red | red | red |
#eeeeff | #eeeeff | rgb(138, 138, 256) |
rgb(1,11,111) | rgb(1,11,111) | rgb(1, 11, 111) |
而Chrome返回值除预定义(red,blue等)的外,
均返回reb形式(notice:判断字符串相等时注意rgb显示中后2个数字的前有个个半角空格)
相关文章推荐
- What are the different versions of JSF and when was it released?
- How to workaround the IE default behavior of re-posting the entire form when pressing "刷新"(or F5)
- Different Types of People Skills - The utility weapon when communication
- When and Why the Superclass Method Has a Different Access Level
- pointer to ref of an array, and to the func that return a ref of an array
- call different method with the same name, parameters and return value, select which one is called using const symbol
- Set the color and font of a GtkLabel
- The what, when and why of wireframes
- No orientation specified, and the default is horizontal. This is a common source of bugs when childr
- No orientation specified, and the default is horizontal. This is a common source of bugs when ...
- Description of the default C and C++ libraries that a program will link with when built by using Vis
- Josh The Egg and The Return of the Shadows
- When ESC is pressed, change the color of the character.
- No orientation specified, and the default is horizontal. This is a common source of bugs when childr
- LeeCode-Sqrt(x)Implement int sqrt(int x). Compute and return the square root of x.
- 翻译A Multiscale Retinex for Bridging the Gap Between Color Images and the Human Observation of Scenes
- CXF报错[1 counts of IllegalAnnotationExceptions]and[Two classes have the same XML type name]and[Use @XmlType.name and @XmlType.namespace to assign different names to them]
- the different of digital and analog
- CSS: the different of using CSS between @import and link
- Customizing the look and feel of a window chrome