Remove tabindex of google maps on my page

I need to remove the tabindex map on my page. I used the code below, but the tab goes through the markers on the map and the Google logo.

var map = new google.maps.Map(document.getElementById('map'),
            mapOptions);

    //Remove o TAB do mapa
      google.maps.event.addListener(map, 'tilesloaded', function() {
          var mapContent = (document.getElementById("map"));
          mapContent('a').attr('tabindex',-1);          
      });

      

+3


source to share


2 answers


Creating Vasil's answer

google.maps.event.addListener(MAP, "tilesloaded", function(){
    [].slice.apply(document.querySelectorAll('#map a')).forEach(function(item) {
        item.setAttribute('tabindex','-1');
    });
})

      



Here he is in action.

+5


source


[].slice.apply(document.querySelectorAll('#map a')).forEach(function(item) { 
   item.removeAttribute('tabindex'); 
});

      



Some like this

0


source







All Articles