Python Get Height Javascript Foreach Function