3
Copyright 2011 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
7
YUI.add('dom-deprecated', function(Y) {
12
children: function(node, tag) {
16
ret = Y.Selector.query('> ' + tag, node);
22
firstByTag: function(tag, root) {
24
root = root || Y.config.doc;
26
if (tag && root.getElementsByTagName) {
27
ret = root.getElementsByTagName(tag)[0];
34
* Finds the previous sibling of the element.
36
* @deprecated Use elementByAxis
37
* @param {HTMLElement} element The html element.
38
* @param {Function} fn optional An optional boolean test to apply.
39
* The optional function is passed the current DOM node being tested as its only argument.
40
* If no function is given, the first sibling is returned.
41
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
42
* @return {HTMLElement | null} The matching DOM node or null if none found.
44
previous: function(element, fn, all) {
45
return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
49
* Finds the next sibling of the element.
51
* @deprecated Use elementByAxis
52
* @param {HTMLElement} element The html element.
53
* @param {Function} fn optional An optional boolean test to apply.
54
* The optional function is passed the current DOM node being tested as its only argument.
55
* If no function is given, the first sibling is returned.
56
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
57
* @return {HTMLElement | null} The matching DOM node or null if none found.
59
next: function(element, fn, all) {
60
return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
67
}, '3.4.1' ,{requires:['dom-base']});