jquery.extend()

Merge contents of two or more objects into the first

HTML

<div>Here's some text!</div>

CSS

div{width:100px;height:100px}

JavaScript

var obj1 = { "color" : "yellow" };
var obj2 = { "background" : "blue" };

var o = $.extend(true, {}, obj1, obj2);

$("div").css(o);