Is there a way to select a component with multiple children, point to one of them and apply css properties or some class?
Let's say I have this div:
<div class="parent"> <div>Child 1</div> <div>Child 2</div> <div>Child 3</div> </div> I would like to apply a css property to the second div.
I've tried this:
$('.parent')[0].children[1].css('display', 'block') But I am getting this error: Cannot read property 'children' of undefined
What I don't understant is that if I log $('.parent')[0].children[1] into the console I get the child div, so, I supposed that would be the way, but it seems that I am wrong.
Is there a way to do that?
[0]=))