In Firefox 3.6 (Firebug console), doing
$('<div style="-x-foo:bar;color:red;" />').attr("style")
results in
"color: red;"
Why are the non-recognized style rules lost?
In Firefox 3.6 (Firebug console), doing
$('<div style="-x-foo:bar;color:red;" />').attr("style")
results in
"color: red;"
Why are the non-recognized style rules lost?
There is no defined action for what a browser should do with unrecognised rules. Some browsers may add them to the DOM but ignore them, others may drop them entirely.
Firefox is one of those that drops unknown rules.
You may have different results in other browsers. The point is that it's undefined, so will be hard to predict what's going to happen, even between versions of the same browser.
I guess the real question is: What is the unrecognised rule you're trying to specify? You're clearly trying to do some kind of clever trick here, and I doubt that the answers you've been given to the question will be the answer you were looking in order for your clever trick to work. Perhaps if you described what it was you were trying to achieve with this unrecognised rule, we could help you find a way of achieving it, especially since your current plan doesn't seem likely to pan out.