Find a named link on the page, then go click it - in Javascript -


i'm using greasekit, needs in javascript, please

what tell human do

click link called < previous opens in new window (in example below, goes page 22, number, needs for specific link)

<table class="v_page_nav" border="0" cellpadding="5" cellspacing="0" width="100%">     <tr>         <td width="100%">showing 551-575 of 610 results</td>         <td>             <a href="/wine/newsletter?ie=utf8&amp;page=22" id="pagination-prev-link">                 < previous</a>| page:</td>         <td class="off"> <a href="/gp/vine/newsletter?ie=utf8&amp;page=1" id="pagination-page-1">1</a>         </td>         <td>...</td>         <td class="off"> <a href="/wine/newsletter?ie=utf8&amp;page=22" id="pagination-page-22">22</a>         </td>         <td class="on"> <a href="/wine/newsletter?ie=utf8&amp;page=23" id="pagination-page-23">23</a>         </td>         <td class="off"> <a href="/wine/newsletter?ie=utf8&amp;page=24" id="pagination-page-24">24</a>         </td>         <td class="off"> <a href="/wine/newsletter?ie=utf8&amp;page=25" id="pagination-page-25">25</a>         </td>         <td>| <a href="/wine/newsletter?ie=utf8&amp;page=24" id="pagination-next-link">next ></a>         </td>     </tr> </table> 

the code:

the last 2 lines of answer probably:

link.target="_blank"; link.click(); 

(this open link in new window) ..but want know how write rest of code; lines go above it.

note

an alternative finding < previous might link id pagination-prev-link

considering last sentence:

var link = document.getelementbyid('pagination-prev-link'); 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -