W3C home > Mailing lists > Public > public-html@w3.org > July 2007

Re: HTML Extensibility Through Script

From: Thomas Broyer <t.broyer@gmail.com>
Date: Thu, 12 Jul 2007 21:38:20 +0200
Message-ID: <a9699fd20707121238h35adb64agb673bdfb32e042bd@mail.gmail.com>
To: public-html@w3.org

2007/7/12, Ben Boyle:
> I would like to know what can be used to detect native support for the
> new input@type values (e.g. date) so javascript can be used to do
> something useful in legacy UAs based on those types but browsers that
> implement their own widgets are left peacefully alone.

You can compare input.type with input.getAttribute("type").
In Opera 9.21 (which supports type=date), both return "date".
In Firefox and IE7, input.type returns "text" while
input.getAttribute("type") is "date".

> I don't know if this is possible with DOMImplementation.hasFeature()
> or not (but I'd like it to be - a good standards based approach).

It is: http://www.whatwg.org/specs/web-forms/current-work/#dom
alert(document.implementation.hasFeature("WebForms", "2.0"));

Thomas Broyer
Received on Thursday, 12 July 2007 19:38:25 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:24 UTC