I want to add doctype for my specific page. How to add it using JavaScript or jQuery?
doctype
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 JavaScript .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
You cannot add DOCTYPE to the current document (or change it).
From MDN-docs : doctype is a read-only property.