Question: I have a link, where I use Javascript to animate a changing of text. The behaviour I'd like to create is the following

1) User hovers over text, a different text fades in
2) When user moves the cursor away, the text goes back to normal. 

I've managed to create the changing of text by looking at another's code, but I'm having trouble making it so that when the cursor leaves the link, the text changes back. 

You can take a look at the jsfiddle here --> 

<http://jsfiddle.net/3WMyQ/>

I get the error 

```
Uncaught TypeError: Object [object Object] has no method 'onmouseout' 

```

Here's the html -->

```
          <a href="#" id="stepan_says">
            <span>The way you get what you want out of life is...</span>
          </a>

```

And here's the JS -->

```
$("#stepan_says").hover(function(){
    $(this).find("span").animate({opacity:0},function(){
        $(this).text("I have no idea! But here's the philosophy!")
            .animate({opacity:1});  
    })
    $(this).onmouseout(function(){
        $(this).find("span").animate({opacity:0},function(){
            $(this).text("This is the third text!")
                .animate({opacity:1});  
        })
    });
});

```

Help much appreciated! :)

Answer: 
Use callback function of `hover` instead of `mouseleave`. You don't need another event. Callback of hover will do exactly what you want.

```
       $("#stepan_says").hover(function(){
            $(this).find("span").animate({opacity:0},function(){
                $(this).text("I have no idea! But here's the philosophy!")
                    .animate({opacity:1});  
            })                              
        },function(){
          $(this).find("span").animate({opacity:0},function(){
                    $(this).text("This is the third text!")
                        .animate({opacity:1});  
                })
        });

```

[demo](http://jsfiddle.net/3WMyQ/1/)
There is no such method `onmouseout` 

Try

```
$(this).mouseleave(function(){
        $(this).find("span").animate({opacity:0},function(){
            $(this).text("This is the third text!")
                .animate({opacity:1});  
        })
    });

```

[**FIDDLE**](http://jsfiddle.net/3WMyQ/1/)