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