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
<script>
alert(document.implementation.hasFeature("WebForms", "2.0"));
</script>

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:02 GMT