Eventually, I wish to dynamically alter gradients based on different things, but how do I get jquery to apply a css3 gradient?
//works
$(element).css(\"bac
Your second approach looks OK... Maybe you need to css styles for non-webkit browsers as well... Cross-Browser CSS Gradient
This works for me in Chrome
$('#block').css({
background: "-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))"
});
Also have a look at: http://www.colorzilla.com/gradient-editor/