how to set css width of an element in javascript code example Example: javascript set element width document.getElementById("myElID").style.width = "100px";