I have the following script
<script>
setTimeout(function() { window.location.reload(); }, 2000); // 2 seconds, e.g.
$('a:contains("13468100")').closest('tr').find('.fightActionInnerInner').click();
</script>
The page has an iframe on it. The script is supposed to search the contents of the iframe for any links which contain the number 13468100 and clicks the tr next to it with an id of 'fightActionInnerInner', refreshing the page every 2 seconds.
The refresh function works, but the script doesn't seem to click the link, even though I know it's there.
Also, I'd like to have an input box where the user can input what they require the script to search for. Example: if they want to search for a link containing "David", they can just type David into a text box and it amends the script.
This is the html I am asking the script to search
<td class="fightMobster">
<div>
<a href="/profile.php?puid=5562089&formNonce=34947b8ffc73e8ceafabae71…94f&setTab1Badge=&h=2d55f5781bfe888b47d7f5c9dbc27df2f663347f">
Lord Pookie
</a>
</div>
<div>
Lvl 212 Daywalker
</div>
</td>
<td class="fightSp"></td>
<td class="fightMobSize">
<span class="cash">
<span style="white-space: nowrap;">
<img width="15" height="14" style="padding-right:2px" src="http://static.storm8.com/zl/images/flesh.png?v=330"></img>
15,300
</span>
</span>
</td>
<td class="fightSpLg"></td>
<td class="fightAction">
<script>
function fsb99995143() {
var b=…
</script>
<a onclick="return fsb99995143();" href="/hitlist.php?tab=fight.php&action=fight&hitlistId=99995143&f…1b4b9390bee9a194f&h=284e4fe4946e6fb8af3a662f4583454eebc8bd23">
<div class="fightActionInner">
<div class="fightActionInnerInner">
Attack
</div>