Skip to content

Commit

Permalink
[feature] new Dom.tag_name function
Browse files Browse the repository at this point in the history
  • Loading branch information
hbbio committed Jan 22, 2014
1 parent 73ea30a commit a171b98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/plugins/opabsl/jsbsl/bslDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1083,3 +1083,10 @@ function thisisthis() {
function get_at_position(x, y) {
return document.elementFromPoint(x, y);
}

/**
* @register {dom -> string}
*/
function tag_name(elt) {
return elt.tagName;
}
8 changes: 8 additions & 0 deletions lib/stdlib/core/xhtml/dom.opa
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,14 @@ Dom = {{
%% BslDom.is_empty %%(of_selection(dom))
)

/**
* @return [name] of element tag
*/
tag_name(elt: dom): string =
(
%% BslDom.tag_name %%(elt)
)

/**
* Iterate on the selection
*/
Expand Down

0 comments on commit a171b98

Please sign in to comment.