kusanagi kusanagi - 3 months ago 7x
Javascript Question

jquery Treeview highlighting selected item

i read docs


also googled, but nothing found easy and good solution, how to highlighting the selected item. i use span so not redirect but nothing selected


You can select li items in the tree and add event listeners to them, like this:

$('#browser li.file').bind('click', function() {
  //clear all clicked items if any
  //set this clicked

Inside handler function 'this' word points to the clicked item. Or if by 'selecting' you mean something else, you can also listen desired event type like in example.

$('#browser li.file').bind('mouseover', function() {
 ... your code ...