I know that I can access to doctype object via document.doctype
or document.childNodes[0]
but my problem is getting doctype as a string. I can do this in chrome and safari by calling document.doctype
which returns <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
. However in Firefox, calling document.doctype
returns DocumentType object.
Is there a way to get the doctype string in all browsers as in chrome and safari?
Thanks!