-1
I have an HTML that mounts DROPDOWN menu.
With JQUERY, I’m trying to make invisible items that don’t have sublists inside.
I tried using the following command, but it didn’t work
$('ul li :not(ul)').hide()
;
The HTML code:
<ul>
<li>
<a href="javascript:void(0)">Opção 1</a>
</li>
<li><a href="javascript:void(0)">Opção2</a>
<ul>
<li><a href="opcao_3.htm">Opção 3</a></li>
<li><a href="opcao_4.htm">Opção 4</a></li>
</ul>
</li>
<li>
<a href="javascript:void(0)">Opção 5</a>
</li>
<li><a href="javascript:void(0)">Opção6</a>
<ul>
<li><a href="opcao_3.htm">Opção 7</a></li>
</ul>
</li>
</ul>
what I did wrong to get a negative point in the question?
– Pedro
It would not be better to generate without items than to hide them afterwards?
– Bacco
Yes, it would be, but I have to change some structures in the database, because the menus are automatically generated through information from it. Jquery would be a palliative solution.
– Pedro
I wouldn’t know how to answer by the person who said no, but you deleted the previous question, which was pretty much the same and had an answer.
– bfavaretto