anyone here know how i can dynamically change the doctype with javascript?
i have tried with this function,
document.doctype('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'); ,
but it does not work.
I hope this one might help some of you ( Tested in Console and it changes actual DOCTYPE)
var newDoctype = document.implementation.createDocumentType(
'html',
'-//W3C//DTD XHTML 1.0 Transitional//EN',
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdd'
);
document.doctype.parentNode.replaceChild(newDoctype,document.doctype);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With