To begin, you select elements with jQuery with the $ symbol:
How to select a specific number n in a list. Given this:
We can see that if we select all li‘s and ask for the first it will give us the first li in each list, whether the list is ordered or not. If we want to select just the first li in the unordered list we have to specify that.
Then to apply a style to the selected object you use the following jQuery method:
Here is a quick example of the .css method:
We can also pass in an object for the styles:
?is this the correct syntax for this? Camel case instead of background-color etc?
!Yes! In jQuery you use camel case instead of actual CSS selectors!
Here are some more quick examples: