Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save StabbyMcDuck/ea78f9edd2b113a4a30204ee7c928949 to your computer and use it in GitHub Desktop.
Save StabbyMcDuck/ea78f9edd2b113a4a30204ee7c928949 to your computer and use it in GitHub Desktop.
function insertHREFs() {
// get all anchor tags
// THIS DOESN'T WORK IN IE OR CHROME - INACTIVE a tags
var queryAllAWithSelector = document.querySelectorAll('a[data-nav-control-id]');
for(var dataLoop=0; dataLoop < queryAllAWithSelector.length; dataLoop++) {
var dataNav = element.getAttribute('data-nav-control-id');
var value = obj.get(dataNav);
concatenateURL(element, value);
}
/*
// THIS WORKS IN CHROME
document.querySelectorAll('a[data-nav-control-id]').forEach(function(element) {
var dataNav = element.getAttribute('data-nav-control-id');
var value = obj.get(dataNav);
concatenateURL(element, value);
}); */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment