I have a program too big for here and so I created a fiddle to illustrate my problem.
I want to catch and save a p
, but alert
is always empty. Can you help me out?
HTML
<ul>
<li>1</li>
<li>2</li>
<li class = "middle_item">
<a>
<div id= "box">
<div id= "header">
<p>1234567</p>
</div>
</div>
<div></div>
<div></div>
</a>
</li>
<li>4</li>
<li>5</li>
</ul>
JavaScript
var aqui = $("li .middle_item .header").text();
alert(aqui);