Q:

How to get css value of an element inside array?

I have a list, and want to get the value of background of the last element.
    <ul>
        <li style="background: red;"></li>
        <li style="background: blue;"></li>
        <li style="background: yellow;"></li>
        <li style="background: white;"></li>
    </ul>

and I use this jQuery script
var color = $( 'ul li' ).get(-1).css('background');

but it's not working. I googled it, but nothing found.
Could any one help me to find out the problem.
EDITED: this is not working on IE, my be I am wrong. but isn't any other way?
$( 'ul li:last' ).css('background');

A:

All answers above will propably output empty string.
Please check:
var color = $('ul li').eq(-1).css('background-color');

In fact, you are seting the background-color, no background itself.
JsFiddle to prove: http://jsfiddle.net/7gxkp/

