w3resource logo

JavaScript Client Objects

JavaScript Window Object : outerWidth Property

Secondary Nav


The outerWidth property specifies the horizontal dimension, in pixels, of the windows outside boundary. The outer boundary includes the scroll bars, the status bar, the tool bars, and other "chrome" (window border user interface elements).


Implemented in JavaScript 1.2



Example of Window object : outerWidth property

The following web document demonstrates how the outerWidth() property can be used.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Window Object : outerWidth Property. Example-1</title>
<h1 style="color: red">JavaScript window Object : outerWidth Property</h1>
<h3>Clicking the following button, a new window will open with 300 pixels outerWidth and 250 pixels outerWidth.</h3>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[
function newwindow()
win1=window.open(' ',' ')
win1.outerHeight = "300"
win1.outerWidth = "250"
win1.document.write("<p>We are learning outerWidth property of window object</p>");
<form name="form1" action="#">
<br />
<input type="button" name="bt1" value="Open New window." onclick='newwindow()' />

View the example of window object's outerWidth property in the browser

Supported Browser

Internet Explorer 7 Firefox 3.6 Google Chrome 7 Safari 5.0.1 Opera 10
Yes Yes Yes Yes Yes

See also :

JavaScript Client side objects, methods, properties.

JavaScript Core objects, methods, properties.

Join our Question Answer community to learn and share your programming knowledge.