A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/width below:

HTMLInputElement: width property - Web APIs

HTMLInputElement: width property

Baseline Widely available

The width property of the HTMLInputElement interface specifies the width of a control. It reflects the <input> element's width attribute.

The width property is valid for the image type only. It defines the preferred horizontal size of the image button, in pixels. The property value is the width of the content-box of the rendered button. CSS box model properties impacting the size of the control take precedence.

If no width is set and no CSS width properties impact the control, the width will be the intrinsic width of the image. If the image didn't load, the value will be the maximum intrinsic width of the alt text. The width will be 0 if the width is not known; if no width is set, no CSS dimensions apply, no image loaded, and either the value of the alt is the empty string or no src is set.

Value

A number.

Examples
const inputElement = document.getElementById("imageButton");
console.log(inputElement.width);
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3