0

I would like to use input type="number" in an XHTML1.1 application.

W3c Input types page says "Input types, not supported by old web browsers, will behave as input type text."

But can I use HTML5 input types in an XHTML 1.1 application?

3
  • 1
    Technically you should not. Practically it'll probably work. However, the XHTML probably won't validate, which sort of negates the point of using XHTML. Commented Dec 22, 2015 at 10:42
  • Well, the point of XHTML was mostly do that you can process HTML with generic XML tools (which would rampage across the markup wiping out all the compatibility hacks rendering it useless in the real world). Commented Dec 22, 2015 at 10:44
  • I've moved to XHTML5 (see profile for site, my mime is application/xhtml+xml, yours is too right?) but if you want to stick with the XHTML 1.1 doctype and want to validate the attribute then @[my name] and when I get home from work later today or tomorrow Wednesday night I'll pick out what I've got (it's frame related even though I've now removed the need for frames). What you want to do is both valid and possible although difficult to come by. Commented Dec 22, 2015 at 18:47

1 Answer 1

2

No, the XHTML 1.1 specification does not allow it.

Yes, browsers don't much care what Doctype you slap on your tag soup documents.


Why not move to HTML 5? You can use the XML serialisation of HTML 5 if you're determined to have XML. It better reflects what browsers actually do with markup than the technological cul-de-sac of XHTML 1.1.

Sign up to request clarification or add additional context in comments.

3 Comments

It's a big change in our project :).. lots of templates
It shouldn't be a big change because the differences (ignoring extra things you can, optionally, add) between XHTML 1.1 and HTML 5 are small.
The only thing in XHTML 1.1 that is not in XHTML5 is the list of entity names. So you won't be able to write entity references like é but you have to make do with the numerical reference é, or even é.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.