html - Javascript code won't work -


i want javascript code push text <td class='one'>. reason doesn't work. can give me hand here please?

<table>   <td class="one"></td> </table>   <script> var freq =[2014,8,11];      //incidents & injuries frequency rate     window.tdone = document.getelementsbyclassname('one');     tdone.innerhtml = countup(freq[0],freq[1],freq[2]);  </script> 

getelementsbyclassname returns array of nodes (array object honest).

use

tdone[0].innerhtml ... 

this insert html first find node. if want insert html found nodes use loop or array map.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -