If you don't want to add each css property line by line, you can do something like this:
document.body.insertAdjacentHTML('afterbegin','<div id="div"></div>');_x000D_
_x000D_
/**_x000D_
* Add styles to DOM element_x000D_
* @element DOM element_x000D_
* @styles object with css styles_x000D_
*/_x000D_
function addStyles(element,styles){_x000D_
for(id in styles){_x000D_
element.style[id] = styles[id];_x000D_
}_x000D_
}_x000D_
_x000D_
// usage_x000D_
var nFilter = document.getElementById('div');_x000D_
var styles = {_x000D_
color: "red"_x000D_
,width: "100px"_x000D_
,height: "100px"_x000D_
,display: "block"_x000D_
,border: "1px solid blue"_x000D_
}_x000D_
addStyles(nFilter,styles);
_x000D_