I was asked today by a senior developer which doctype I'd use if I was going to write something (personal / non-commercial) for the open web.
I responded, <!doctype html>
, to which I was greeted with a look of shock, horror and surprise and then asked to explain myself.
To my mind, it's a good candidate because current browsers (IE, FF, Opera, Safari) will look at it and switch the content into standards mode - even though they don't implement HTML5. If I want to actually take advantage of HTML5 elements, I can use some javascript to create a reference to those tags not recognised by, say, IE (e.g. document.createElement('article');
) and then work with them as if they were native parts of the DOM.
Was this really such a bad answer? What would you have answered and why?