How to select the 2nd element of a type

How to select the 2nd element of a type

Hi, I wrote the following jQuery script...and it's basically working. Note that it's in Drupal so the beginning and ending syntax is a little odd. Please focus on the content between  $("A").each(function () { and   });

  1. // used to change background-color of currently selected link
  2. (function ($, Drupal) {
  3.   'use strict';

  4.     $("A").each(function () {
  5.       if (this.href == document.URL) {
  6. $(this).parent().css("background-color", "#c03c03");
  7. $(this).css("color", "white");
  8.       }
  9.   });
  10. })(jQuery, Drupal);
The purpose of this, as is probably obvious, is to select the <div> that contains a link on the navigation bar, that matches the current url, and change it's background color and the link color.

However, I have TWO navigation menus on the page.

I only want this script to change the css properties on the 2ND of the two 'a' tags.

How can I target only this second 'a' tag (and parent)?