1

I dont know if I seem stupid by askin this simple question but on one interview some one asked me How Does the browser know if the language written is Html5 ??

I answered him by Doctype browser getta know if it is Html5 then he said if I did not give Doctype and place a video or any html5 tag will it not run??

I told him it`ll run and then he said then what is the use of doctype if give or not.

Please tell me how our browser identifies / differentiates the html we use as Html4 or Html5

ChAmp NOmi
  • 51
  • 5
  • No he said will call me it was 2 days before. I am expecting to get a call – ChAmp NOmi Oct 22 '13 at 13:07
  • Hey why you guys deduct my points I mean I have read that article too but dint find my answer & before posting this question I looked Stackoverflow thoroughly to avoid duplicated ques. I dont think that above mentioned question is same as the one i asked? if it is then tell me how? – ChAmp NOmi Oct 22 '13 at 13:09

1 Answers1

2

The simple answer is that browsers don't detect HTML5 as distinct from other versions of HTML. They don't know and they don't care. Just the same as they don't know or care which version of JavaScript or level of CSS is being used.

Having said that, that's probably not what the interviewer was fishing for. You were probably right to mention the doctype, any you should probably have continued by describing quirks mode versus standards mode behaviour.

Alohci
  • 78,296
  • 16
  • 112
  • 156