Question

I am having a page with many button's , I have to Click on each button to Activate a user which takes a lot of time . I was wondering if Is it possible to invoke a link through Firefox / Chrome console ?

For instance suppose there is a Class

<a class="Button" href="#" link="/info.php?code=379645838760724 id="uqyiqh_25">
<span class="ButtonText">Click Here to activate user Greg</span></a>

I want to fire the link part of the tag with the help of console ? Can I use the Console to select this ID and Call the Link ?

Was it helpful?

Solution

var elements = document.getElementsByClassName('Button');
for (var i = 0; i < elements.length; i++) {  
  var request = new XMLHttpRequest();  
  request.open('GET', elements[i].href, true);
  request.send();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top