|
HTML DOM Input DatetimeLocal 对象 Input DatetimeLocal 对象 Input DatetimeLocal 对象是 HTML5 新增的。
Input DatetimeLocal 对象表示使用 type="datetime-local" 的 HTML <input> 元素。
注意:Internet Explorer 或 Firefox 浏览器不支持 <input> 元素。 访问 Input DatetimeLocal 对象 你可以使用 getElementById() 函数来访问使用 type="datetime-local" 属性的 <input> 元素:
var x = document.getElementById("myLocalDate");
提示: 你同样可以通过表单的元素[/url]集合来访问 Input DatetimeLocal 对象。 创建 Input DatetimeLocal 对象 你可以使用 document.createElement() 方法来创建使用 type="datetime-local" 属性的 <input> 元素:
var x = document.createElement("INPUT");
x.setAttribute("type", "datetime-local"); Input DatetimeLocal 对象属性
属性 | 描述 |
---|
autocomplete | 设置或返回本地时间字段的 autocomplete 属性值 | autofocus | 设置或返回本地时间字段在页面加载后是否自动获取焦点 | defaultValue | 设置或返回本地时间字段默认的值 | disabled | 设置或返回本地时间字段是否可用 | form | 返回使用本地时间字段的表单引用 | list | 返回包含了本地时间字段的 datalist 引用 | max | 设置或返回本地时间字段的 max 属性值 | min | 设置或返回本地时间字段的 min 属性值 | name | 设置或返回本地时间字段的 name 属性值 | readOnly | 设置或返回本地时间字段是否只读 | required | 设置或返回本地时间字段在表单中是否为必填字段 | step | 设置或返回本地时间字段的 step 属性值 | type | 返回本地时间字段的表单元素类型 | value | 设置或返回本地时间字段的 value 属性值 |
标准属性和事件 Input DatetimeLocal 对象同样支持标准 属性和 事件。
程序猿的技术大观园:www.javathinker.net
[这个贴子最后由 flybird 在 2020-02-24 11:24:29 重新编辑]
|
|