Take a look at this simple demonstration:
I am attempting to modify the attribute of a div, and based on the attribute's value, apply the corresponding CSS. When the page loads, the attribute selector functions correctly and applies the appropriate CSS. However, if the attribute is changed through JavaScript, the CSS is not applied. This issue persists even on mobile devices.
Confirmed working in Chrome version 21.0
Tested on Safari version 5.1.7