Here is few line of java script code to create a div element dynamically. But my doubt is after create that element, is there any short-cut way to assign multiple css rules instead of typing (container.style) again and again.
<script>
(function(){
window.onload = function(){
var container = document.createElement('div');
container.style.width = '500px';
container.style.height = '200px';
container.style.backgroundColor = 'red';
container.style.margin = '0 auto';
document.body.appendChild(container);
}
}());
</script>
.css()which you can use to apply many css styles.