Skizit Skizit - 3 months ago 33
CSS Question

Set CSS attribute in Javascript?

I've created the following...

var menu = document.createElement('select');


How would I now set CSS attributes e.g
width: 100px
?

Answer
var obj= document.createElement('select');
obj.style.width= "100px";