html input image 尺寸,HTML DOM Input Image 对象
# HTML DOM Input Image 對(duì)象
## Input Image 對(duì)象
Input Image 對(duì)象是 HTML5 中的新對(duì)象。
Input Image 對(duì)象表示 HTML 元素。
### 訪問 Input Image 對(duì)象
您可以通過使用 getElementById() 來訪問 元素:
~~~
var x = document.getElementById("myImage");
~~~
提示:您也可以通過遍歷表單的[elements 集合](https://www.kancloud.cn/jsref/coll_form_elements.asp "HTML DOM elements 集合")來訪問 Input Image 對(duì)象。
### 創(chuàng)建 Input Image 對(duì)象
您可以通過使用 document.createElement() 方法來創(chuàng)建 元素:
~~~
var x = document.createElement("INPUT");
x.setAttribute("type", "image");
~~~
## Input Image 對(duì)象屬性
| 屬性 | 描述 |
| --- | --- |
| autocomplete | 設(shè)置或返回 email 字段的 autocomplete 屬性值。 |
| alt | 設(shè)置或返回 input image 的 alt 屬性值。 |
| autofocus | 設(shè)置或返回 input image 在頁面加載后是否應(yīng)自動(dòng)獲取焦點(diǎn)。 |
| defaultValue | 設(shè)置或返回 input image 的默認(rèn)值。 |
| disabled | 設(shè)置或返回 input image 是否被禁用。 |
| form | 返回對(duì)包含 input image 的表單的引用。 |
| formAction | 設(shè)置或返回 input image 的 formaction 屬性值。 |
| formEnctype | 設(shè)置或返回 input image 的 formenctype 屬性值。 |
| formMethod | 設(shè)置或返回 input image 的 formmethod 屬性值。 |
| formNoValidate | 設(shè)置或返回在提交表單時(shí)是否應(yīng)該驗(yàn)證表單數(shù)據(jù)(form-data)。 |
| formTarget | 設(shè)置或返回 input image 的 formtarget 屬性值。 |
| height | 設(shè)置或返回 input image 的 height 屬性值。 |
| name | 設(shè)置或返回 input image 的 name 屬性值。 |
| src | 設(shè)置或返回 input image 的 src 屬性值。 |
| type | 返回 input image 字段的表單元素類型。 |
| value | 設(shè)置或返回 input image 的 value 屬性值。 |
| width | 設(shè)置或返回 input image 的 width 屬性值。 |
### 標(biāo)準(zhǔn)屬性和事件
Input Image 對(duì)象支持標(biāo)準(zhǔn)[屬性](https://www.kancloud.cn/jsref/dom_obj_all.asp "HTML DOM Element 對(duì)象")和[事件](https://www.kancloud.cn/jsref/dom_obj_event.asp "HTML DOM Event 對(duì)象")。
## 相關(guān)頁面
HTML 教程:[HTML 表單](https://www.kancloud.cn/html/html_forms.asp)
HTML 參考手冊(cè):[HTML 標(biāo)簽](https://www.kancloud.cn/tags/tag_input.asp)
HTML 參考手冊(cè):[HTML type 屬性](https://www.kancloud.cn/tags/att_input_type.asp)
總結(jié)
以上是生活随笔為你收集整理的html input image 尺寸,HTML DOM Input Image 对象的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: typora将html转为格式,Typo
- 下一篇: 2021广东省高考成绩查询时间,广东省高