how to set width and height of div dynamically using javascript code example Example: javascript set div height document.getElementById("myBtn").style.height = "50px";