I need to get content from a div. I'm actually building a dynamic menu, where I define
<li class="menuLi">
<div class="acao">-3</div>
<div class="desc">Inicio</div>
</li>
Then I have an ajax that should take this acao
and send it to a page to know which page it will load. But when I get this action it is not coming, the attribute comes as undefined
.
The code js.
function carregarPaginas() {
$(".menuLi").click(function (e) {
e.preventDefault();
var acao = $(this).attr('href');
location.href = 'includes/publicacao.php?c='+acao;
});
}