How to click multiple instances of the same icon on a webpage? (Javascript)
Posted
by
akd
on Stack Overflow
See other posts from Stack Overflow
or by akd
Published on 2011-01-14T17:52:39Z
Indexed on
2011/01/14
17:53 UTC
Read the original article
Hit count: 97
JavaScript
I want to write a script that will click every instance of a certain icon. The following code is from the source that is what I want to click on. It has a onclick event defined, I just don't know how to search the page for these icons and then click on them. Can anyone help? Thanks.
<dd><a href="javascript:void(0);"
onclick="RecommendItem(1,'article','6106925','1','recommendstatus_article6106925' ); return false;"
onmouseover="return overlib('Give thumbs up', WRAP);"
onmouseout="return nd();"> <img class='icon' title='' alt='Thumb up' style='background-position: -304px -48px;' src='http://geekdo-images.com/images/pixel.gif' /></a></dd>
<dt class='tippers'><a href="javascript://" style='color: #969600;' onclick="RecSpy( 'article', '6106925', 'tippers' ); return false;"></a></dt>
© Stack Overflow or respective owner