excelVBAmaster.com
excelVBAmaster.com

Reputation: 158

Get innerHTML from table

I'm trying to create a popup that displays the Price of FTC when the table loads using javascript. I'm running my script using GreaseMonkey in Firefox.

The site I'm running my code on is: https://www.coinmkt.com/#/ The code below does run the script once, but my innerHTML is undefined. Can anyone help me return the value of FTC? Thanks in advance:

function myScript(){
    if(document.getElementById('reverse-exchange-rates')){
        alert(document.getElementById('reverse-exchange-rates').getElementsByTagName('td')[5].getElementsByTagName('span')[0].InnerHTML);
        clearInterval(RunNewIteration);
    }
    var RunNewInteration = setTimeout(myScript, 5000);
}

myScript();

Upvotes: 1

Views: 3164

Answers (2)

Bellash
Bellash

Reputation: 8204

copy/paste this! innerHtml was wrongly spelled

function myScript(){
if(document.getElementById('reverse-exchange-rates')){
    alert(document.getElementById('reverse-exchange-rates').getElementsByTagName('td')[5].getElementsByTagName('span')[0].innerHTML);
    clearInterval(RunNewIteration);
}
var RunNewInteration = setTimeout(myScript, 5000);
}

 myScript();

Upvotes: 0

matewka
matewka

Reputation: 10158

It should be:

innerHTML

Not:

InnerHTML

The first letter must be small-case.

Upvotes: 2

Related Questions