Is there a way to add a Tooltip to a JSTree node? I would like to display extra information when the user hovers over an element.
I\'m pretty dense when it comes to
Use the "a_attr" or "li_attr" to add a title, depending on which element you want the title to be on, as documented here: https://www.jstree.com/docs/json/
If using the "create_node" function, then do it like this:
$("#my_tree").jstree("create_node",
"my_node",
"inside", {
"attr": {
"id": "my_node"
},
"li_attr": { //or a_attr if you prefer
"title": "my tooltip text",
"class": "show_tooltip"
},
"text": "my node text"
});
The above will show a tooltip in the browser. If you want to use a custom tooltip (e.g. Bootstrap), then you can simply call $(".show_tooltip").tooltip();