1

I want to change all the labels links and have a specific number to access it in blogger using JavaScript automatically An illustrative example

../search/label/Label_name and add max-results=7 after "label name"

how i can do it .. i want help and thank you.

MSDesCUC
  • 17
  • 5

1 Answers1

1

Something like this should do the trick. If you have further questions feel free to ask them :)

var x = document.querySelectorAll("a");

x.forEach(function(element){
  var link = element.href;
  console.log(link)
  element.href = link + "?max-results=7";
  console.log(element.href);
});
<a href="../search/label/Label_name">Example link</a>
Aaron
  • 1,600
  • 1
  • 8
  • 14