On Nov 17, 3:52 pm, szuwei <sweit...@hotmail.com> wrote:
> If you have an unordered list with 10 elements. The list has an ID of
> “myList”.  Using jQuery, how can you:  
>
>    1. Change the fore color of all even list items to red
>    2. Indent the 5th item when the mouse hovers over it

Is this a homework problem?  I guess if it is, your instructor
probably knows enough to monitor this list too.

It's pretty straightforward:  (http://jsbin.com/esole/edit)

  $("#myList li").filter(":odd").css({color: "red"}).end()
          .eq(4).hover(function(){$(this).css({textIndent: "2em"})},
                       function(){$(this).css({textIndent: "0"})});

Cheers,

  -- Scott

Reply via email to