How do I find the declaration of a webpage with JS?

Viewed 37

I am trying to find the <!DOCTYPE html> tag of a webpage with JS.

For example if the declaration was <!DOCTYPE foo> I want to be able to find that with JS.

I do not want jquery for this.

I am trying to write somthing like on
this W3schools Link But it does not work...

0 Answers
Related