Log the nth-child number – Jquery
How do I log the the nth-child number of an element in a container using jQuery. Thanks in advance. $('.wrapper p').on('click', function() { //log the nth-child number of the clicked element console.log($(this).nth-child()) }) p { cursor: pointer; } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>…