Question: I need to call the id value from another function
Here the code

```
$("p").hover(function() {
    var i = $(this).text();
    $("#o").show();
}, function() {
    $("#o").delay(2000).fadeOut("slow");
});
$("#o").click(function() {
    $(".display").append(i);
});​

```

I need "i" value display on ".display" class div.
Any one can help me please..

Answer: 
Simply declare `i` outside..

```
var i = '';
$("p").hover(function() {
   i = $(this).text();
   $("#o").show();
}, 
function() {
   $("#o").delay(2000).fadeOut("slow");
});

$("#o").click(function() {
   $(".display").append(i);
});

```
To add to Vega's answer, I would wrap it in an anonymous function to avoid polluting the global scope.

```
(function() {
    var i = '';
    $("p").hover(function() {
        i = $(this).text();
        $("#o").show();
    }, function() {
        $("#o").delay(2000).fadeOut("slow");
    });
    $("#o").click(function() {
        $(".display").append(i);
    });​

})();

```

The variable is still accessible to the inner callback functions after the outer function has returned, because javascript has a nice thing called [closures](http://jibbering.com/faq/notes/closures/).