Skizit Skizit - 20 days ago 6
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";
Comments