Abel Tamayo schrieb:
> Try this:
>
> $("#id1").css("textDecoration", "line-through");
>
> Remember that when you use the .css function to set a style, it must
> becapitalized camel-style; that is "text-decoration" becomes
> "textDecoration" and the same happens with backgroundColor, etc...
This was a bug that has been fixed a while ago. There are three ways,
each one will work. If you pass an object literal to css() you have to
remember to use quotes if you want to stick to the "-":
// pair of strings
$("#id1").css("text-decoration", "line-through");
// object literal with quoted property name
$("#id1").css({"text-decoration": "line-through"});
// object literal without quoted property name
$("#id1").css({textDecoration: "line-through"});
Passing in object literals is handy if you want to set different styles
at once.
$("#id1").css({"text-decoration": "line-through", color: "red"});
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/