[Solved] Why does this work? (JQuery) [closed]


  1. No. It is a CSS property, passed as literal string, in order to be interpreted as CSS property by jQuery.
  2. No. CSS properties are transformed to CamelCase when used in JS. Although jQuery can also take them in the hyphenated form, the author of your example has chosen to camel-case them, so they don’t need to be quoted. (For reasons of readability.)
  3. No. Semicolons in CSS are used to separate multiple rules. The last rule doesn’t need to be terminated with a semicolon #foo { color: white } is perfectly legal in CSS.
  4. No. Semicolons in JS indicate a logical line ending, nothing else. Also, they are optional, if there’s a physical line ending (i.e. a line-break like \n) instead.

4

solved Why does this work? (JQuery) [closed]