How to add doctype in html page using JavaScript or jQuery
I want to add a doctype
for my particular page. How can I add it using JavaScript or jQuery?
I want to add <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
using J开发者_如何学编程avaScript.
You cannot add a DOCTYPE to the current document(or modify it).
From the MDN-docs: doctype is a read-only property.
精彩评论