javascript - Print Out Jquery object to table -


i got script count td same value's in table. output need.

but goes wrong when want print data html. when console.log get

object {eandis - rc grond 2014-2018: 11, aswebo - farys: 7, vdv cleaning - rioolkolkenslib: 1}

i have tried print out with: document.getelementbyid("write").innerhtml = bytechnology; output objectobject.

what doing wrong? or way it?

here find script. hope can me!

<script>     var bytechnology = {};      $("#test tbody td:nth-child(6)").each(function() {         var tech = $.trim($(this).text());          if (!(bytechnology.hasownproperty(tech))) {             bytechnology[tech] = 0;         }          bytechnology[tech]++;     });      console.log(bytechnology);     document.getelementbyid("test").innerhtml = bytechnology; </script> 

try:

document.getelementbyid("write").innerhtml = json.stringify(bytechnology); 

the json.stringify() method converts javascript object json string.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -