I want to be able to dynamically change width and height in a div that gets created by a function. The code below works but the style rules gets added directly in the HTML document, which is something I want to avoid. Instead I want the properties to be added directly to the CSS file. Is there a way to achive that?
...function(width, height) {
var div = $('<div/>', {
class': 'window',
width': width,
height': height
}).appendTo('#content');
}