javascript - How to write a script to click certain image links? -
i'm trying open links on webpage, code each link approximately following:
<a href="/tor/download.php/*jibberish_letters*" id="dllink137836"><img border="0" src="/pic/down.png" alt="download" title="download"></a> the script i'm attempting use following, 'undefined' error when try run it.
var links = document.queryselectorall('a[title="download"]'); (var = 0; < links.length; i++) { window.open(links[i].href,"_blank"); } any appreciated. thanks!
this worked me:
var links = document.queryselectorall('img[title="download"]'); (var = 0; < links.length; i++) { window.open(links[i].parentnode.href,"_blank"); }
Comments
Post a Comment