Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Belgian Biodiversity Platform
yeti
Commits
0aecffda
Commit
0aecffda
authored
Oct 11, 2012
by
Julien Cigar
Browse files
added Yeti.DOM.firstElementTag
parent
c64814b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
core.js
View file @
0aecffda
...
@@ -492,6 +492,21 @@
...
@@ -492,6 +492,21 @@
})(
name
,
src
);
})(
name
,
src
);
}
}
/* Yeti.DOM.firstElementTag
* Returns a reference to the first child node of that element which is of
* nodeType 1 and of tag <tag>.
*/
Yeti
.
DOM
.
firstElementTag
=
function
(
elem
,
tag
)
{
var
tag
=
tag
.
toUpperCase
();
for
(
var
i
=
0
,
_len
=
elem
.
childNodes
.
length
;
i
<
_len
;
i
++
)
{
if
(
elem
.
childNodes
[
i
].
nodeType
===
1
&&
elem
.
nodeName
.
toUpperCase
()
==
tag
)
{
return
elem
.
childNodes
[
i
];
}
}
return
null
;
}
/* Yeti.DOM.removeNodes
/* Yeti.DOM.removeNodes
* Removes all child nodes from an element.
* Removes all child nodes from an element.
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment