Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLInputElement
  4. height

HTMLInputElement: height property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Theheight property of theHTMLInputElement interface specifies the height of a control. It reflects the<input> element'sheight attribute.

Theheight property is valid for theimage type only. It defines the vertical dimension of the image button, in pixels. If CSS sizing properties apply to the control, the value is the height of the content box of the rendered control, not the value of theheight attribute. If noheight is set and CSS does not impact the control's size, theheight will be the intrinsic height of the image. If the image didn't load, the value will be the height of thealt text. Theheight will be0 if the height is not known; if noheight is set, CSS doesn't impact the height, the image didn't load, and either the value of thealt is the empty string or nosrc is set.

Value

A number.

Examples

js
const inputElement = document.getElementById("imageButton");console.log(inputElement.height);

Specifications

Specification
HTML
# dom-input-height

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp