moidul dargahi moidul dargahi - 1 month ago 7
CSS Question

Changing color of an anchor's title

I want to change the title color for anchor tags which are below

container
class.

jQuery



$(document).ready(function(){
$('[title]').colorTip({color:'yellow'});
});


HTML



<div class="container">
<a href="http://tutorialzine.com/" title="title only here.">congue</a>
</div>


It doesn't appear to change the color. Any advice?

Answer

Change:

$('[title]').colorTip({color:'yellow'});

to:

$('div.container > a[title]').colorTip({color:'yellow'});

The div.container > a[title] means only select an anchor with a title attribute that is a child of a div with the container class.

Comments