Let's select the list item with an ID of listItem
and then give it a red color using the .setStyle()
MooTools method.
Inside your
window.addEvent('domready')
method, use the following code:$('listItem').setStyle('color', 'red');
Save the HTML document and view it on your web browser. You should see the third list item in red.
Now let's select the entire unordered list (it has an ID of
superList)
, then give it a black border (in hexadecimal, this is #000000). Place the following code, right below the line we wrote in step 1:$('superList').setStyle('border', '1px solid #000000');
If you didn't close your HTML document, hit your browser's refresh button. You should now see something like this: