Whilst recently working on a WordPress theme I needed a way to apply gradients to elements via Javascript without having to write 5 separate lines for supporting the multitude of various browser prefixes for varied support so I wrote a plugin after Googling and not finding anything similar. The plugin is called Gradientizer and can be found on Github here.
The plugin is very simple, you can have multiple colours (simply specify the percentage value and colour) and optionally your gradient direction (vertical or horizontal). That’s all there is to it. If you look at the Github repo above you’ll also see a simple example in the README and description showing you how to use it.