Xriuk Xriuk - 1 year ago 105
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?


Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download