How to save/persist and access data on client side in javaScript:Jquery?

I am using jsTree component of Jquery:JavaScript.

In bind() of jstree, after selection of node I want to save "data"

```
.bind("select_node.jstree", function (event, data) { 
// where & how to save data ?
}

$("#Btn").click(function() {
// I want to access data value on click event
}

```

I tried to set data object in cookie and accessed same in $("#Btn").click(function() {...
But can't access same data object

+

I also tried jQuery.data() i.e.
In bind() set data like.... 

```
jQuery.data(div, "selectedNode", data);

```

and tried to access in $("#Btn").click(function(){.... like

```
var selectedNodeData = jQuery.data(div, "selectedNode"); // Can't access

```

Any help or guidance in this matter would be appreciated.