wow, you've been as fast as Lightning...

That was exactly the point!

With quotes it work perfectly.

cheers again,

Andrea

On Apr 9, 12:52 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 9, 2008 at 7:39 AM, ^andrea^ <[EMAIL PROTECTED]> wrote:
>
> > when I load the page and I do this:
>
> > $(document).ready(function(){
> > $("#menu_id0").css({ background-color:"red" });
> > });
>
> > but Firebug tells me:
> > missing : after property id
> > [Break on this error] $("#menu_id0").css({ background-color:"red" });
> > \n
>
> the hyphen/dash ( - ) isn't valid in a javascript variable name. You've got
> two options:
>
> Quotes:
> $("#menu_id0").css({ "background-color":"red" });
>
> camelCase:
> $("#menu_id0").css({ backgroundColor:"red" });
>
> Note: The quotes around the key in a javascript hash can always be used,
> even if they're not needed. This is a case where they are needed.
>
> - Richard
>
> Richard D. Worthhttp://rdworth.org/

Reply via email to