1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-15 23:35:34 +00:00

[assert] document.doctype

This commit is contained in:
Witold Filipczyk 2024-04-12 19:18:08 +02:00
parent 317361d63b
commit 1445d613c6

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the doctype name of the document.</p>
<button onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> In Internet Explorer 8 and earlier, the doctype property returns <em>null</em> for HTML and XHTML documents, and will only work for XML documents.</p>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.doctype.name;
console.assert(x === 'html', 'html');
}
console.error('document.doctype.html');
myFunction();
console.exit(0);
</script>
</body>
</html>