Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KronicDeth/49909c61b594d4ec108f57fdd86d35f1 to your computer and use it in GitHub Desktop.
Save KronicDeth/49909c61b594d4ec108f57fdd86d35f1 to your computer and use it in GitHub Desktop.
function insertHREFs() {
// get all anchor tags
// THIS WORSK IN IE OR CHROME
var navControlLinks = document.querySelectorAll('a[data-nav-control-id]');
for(var i=0; i < navControlLinks.length; i++) {
var element = navControlLinks[i];
var dataNavControlId = element.getAttribute('data-nav-control-id');
var value = obj.get(dataNavControlId);
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