Reputation: 211
I have a program, but it's too big to spam it here, so I made a fiddle to illustrate my problem.
I need to catch and store in a variable the number 6
, but alert gives me undefined
or [object]
. Can you help me please?
HTML
<ul>
<li>1</li>
<li>2</li>
<li class = "middle_item">
<a>3</a>
<a>6</a>
<a>7</a>
</li>
<li>4</li>
<li>5</li>
</ul>
JavaScript
var aqui = $("li.middle_item").get("a:nth(2)");
alert(aqui);
Upvotes: 1
Views: 31