It is possible to get something like this from jquery?
<div id="test" style="background: -webkit-linear-gradient(top, #2F2727, #1a82f7);
background: -moz-linear-gradient(top, #2F2727, #1a82f7);"/>
When I use:
$("#test").css({
'background': '-webkit-linear-gradient(top, #2F2727, #1a82f7)',
'background': '-moz-linear-gradient(top, #2F2727, #1a82f7)'
});
the result is (in chrome)
<div id="test" style="background: -webkit-linear-gradient(top, #2F2727, #1a82f7); "/>
That is not possible in jQuery, because the keys cannot be duplicated. You have to use
$.cssHooksor:Instead of setting fixed styles using
style, I recommend to use the*Classfunctions:addClass,removeClassandtoggleClass.As for the HTML, you have to use the
styleattribute: