diff options
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md b/ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md new file mode 100644 index 00000000..926f90a5 --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md @@ -0,0 +1,29 @@ +--- +title: getNodeByHtmlElement +name: functions-getnodebyhtmlelement +--- + +**function getNodeByHtmlElement(html_element);** + +Get a tree node by an html element. The html element should be: + +* The `li` element for the node +* Or, an element inside the `li`. For example the `span` for the title. + +{% highlight js %} +var element = document.querySelector('#tree1 .jqtree-title'); + +var node = $('#tree1').tree('getNodeByHtmlElement', element); + +console.log(node); +{% endhighlight %} + +The element can also be a jquery element: + +{% highlight js %} +var $element = $('#tree1 .jqtree-title'); + +var node = $('#tree1').tree('getNodeByHtmlElement', $element); + +console.log(node); +{% endhighlight %} |