which unit to set width of div in javascript code example Example: jquery element width // Returns width of HTML document $( document ).width();