There is a sign with a list of goods. I want to make a drop-down list when you click on +
separately for each product. How can this be done without interfering with the html
structure? The hitch is that the quantity of goods and names in it can be various without restrictions. While reveals only 1 item after the name of the goods.
$('.plus').click(function() { $(this).parents('.order').next('.order_item').toggle(); });
.order_item { display: none; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table class="order-count"> <tr class="order"> <td>Π’ΠΎΠ²Π°Ρ 1 <span class="plus">+</span> </td> </tr> <tr class="order_item"> <td>ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅ 1</td> </tr> <tr class="order_item"> <td>ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅ 2</td> </tr> <tr class="order"> <td>Π’ΠΎΠ²Π°Ρ 2 <span class="plus">+</span> </td> </tr> <tr class="order_item"> <td>ΠΠ°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΠ΅ 1</td> </tr> </table>