The first one below works, that is a:first detects the 1st link, but a:second doesn't. How can I detect the 2nd link on a page using jQuery?
<script type="text/javascript">
$(document).ready(function() {
$('a:first').click(function() {
alert('you clicked 1st link');
});
$('a:second').click(function() {
alert('you clicked 2nd link');
});
});
</script>
<a href="#">1st Link</a>
<a href="#">2nd Link</a>