Xriuk Xriuk - 6 months ago 41
jQuery Question

How to select an anchor inside several other elements

I have this in my CSS:

#slider div.mc-caption a

How can I select this element via JQuery?



try this ... this is known as selector

console.log($('#slider div.mc-caption a'));
$('#slider div.mc-caption a').click(function()

and with HTML

<div id="slider">
    <div class="mc-caption"><a href="javascript:void(0)">Testing</a></div>

Click here for fiddle