开发者

How to add doctype in html page using JavaScript or jQuery

开发者 https://www.devze.com 2023-03-30 05:12 出处:网络
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/

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消