gecko-dev/dom/tests/js/simple.js

39 строки
649 B
JavaScript
Исходник Обычный вид История

/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 15:12:37 +04:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1998-04-14 22:16:23 +04:00
1998-04-14 00:24:54 +04:00
var node = document.documentElement
node.nodeType
1998-04-14 00:24:54 +04:00
node.tagName
1998-04-14 00:24:54 +04:00
var attrList = node.attributes
1998-04-14 00:24:54 +04:00
attrList.length
1998-04-14 00:24:54 +04:00
var attr = attrList.item(0)
1998-04-14 00:24:54 +04:00
attr.name
1998-04-14 00:24:54 +04:00
attr.value
node.hasChildNodes
1998-04-14 00:24:54 +04:00
var children = node.childNodes
1998-04-14 00:24:54 +04:00
children.length
1998-04-14 00:24:54 +04:00
node = children.item(1);
node.nodeType
1998-04-14 00:24:54 +04:00
node.tagName
1998-04-14 00:24:54 +04:00
node = node.firstChild
1998-04-14 00:24:54 +04:00
node = node.nextSibling
1998-04-14 00:24:54 +04:00
node = node.parentNode
1998-04-14 00:24:54 +04:00
1998-04-14 22:16:23 +04:00