All
I want to get only "All" without <ins>
When I use $j(this).parent().html() I get
<ins class="jstree-checkbox"> </ins>
<ins class="jstree-icon"> </ins>
All
but I need only "All" How can I get it ?
Assuming the .parent() part is correct, try this:
var result = $j(this).parent().contents().last().text();
You may want to trim the result, because there will likely be white space.
var result = $j(this).parent().contents().last().text();
result = $j.trim(result);
Or if there isn't any other text, you can just do this:
var result = $j(this).parent().text();
var result = $j(this).parent().contents().last().text(); (jsfiddle.net/krLw3).text() on the next line.Try the following to get 'All'
obj = $(this).parent().get(0);
var allText = obj.lastChild.nodeValue;
var allText = this.parentNode.lastChild.nodeValue; :o)