@krista Используйте метод children() в jQuery чтобы найти у $(this) дочерние элементы, ниже пример кода на jQuery:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<html> <head> <meta charset="utf-8"/> <script src="https://code.jquery.com/jquery-2.0.1.js"></script> </head> <body> <div class="container"> <a href="#" class="button"> <span>Кнопка 1</span> </a> </div> </body> <script> $('.button').click(function () { // Вывод: span console.log($(this).children()) }); </script> </html> |