mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[assert] document.doctype
This commit is contained in:
parent
317361d63b
commit
1445d613c6
25
test/ecmascript/assert/document.doctype.html
Normal file
25
test/ecmascript/assert/document.doctype.html
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user