I have the following code that identifies which element has been clicked, but how can I tell which element has not been clicked?
$('body').on('click', '.container-abd a', function(){
var element = $(this).attr('href');
alert(element)
})
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container-abd sticky-top">
<ul>
<a href="#ebasic-profile">
<li><i class='bx bx-layer'></i>Basic</li>
</a>
<a href="#security">
<li><i class='bx bx-shield'></i>Security</li>
</a>
</ul>
</div>
</body>
You can achieve it using
siblings()
like this: