I need to target the second child of the parent foo
. How can I do that?
$("#one").click(function() {
// How to get "me" if I do not know the classname?
// I need to target that second div (I know that it's second).
var q = $(this).eq(1).attr('class');
console.log(q); // undefined
// Aim?
// I need that element or classname
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="one" class="foo">
<div>one</div>
<div class="me"></div>
</div>