How can we add doctype using javascript

I want to add doctype using javascript. when doctype already exists, I can modify it. but when it is null, cannot add a new doctype .. how can I do this in JS

+1
source share
1 answer

It is completely useless to add doctype using JavaScript, since doctype will be resolved before JavaScript can add it to the page. Editing or adding a doctype type using JavaScript will not cause the page to display using processed JavaScript doctype.

+1
source

Source: https://habr.com/ru/post/1525020/


All Articles