Set Title for image by jquery

by Mohan 2014-06-17 18:42:07

Set title for image by jquery

Here is a simple example to set title for an image by jquery.

<code>
<li><a href="home.html"><img src="images/menu1.jpg" ></a></li>
<li><a href="login.html"><img src="images/menu2.jpg"></a></li></code>



$(document).ready(function(){

        $('.menu li').mouseover( function(){
            var src = $(this).find('a').attr('href');
            $('.hbg').attr('title', 'title name here'); 

        });     
    });

When mouse is moved over the list, the title will be shown.

Tagged in:

628
like
0
dislike
0
mail
flag

You must LOGIN to add comments