Reputation: 12512
If I have a div with an inline style specifying background color, how do I get the color value on click w/ jQuery?
$(".myDiv").click(function(){
var myColor = $(this)....
});
<div class="myDiv" style="background-color:#8080C0"></div>
Upvotes: 0
Views: 74
Reputation: 254944
$(this).css('background-color')
http://jsfiddle.net/zerkms/eWWXT/
Upvotes: 2