「JavaScript」for文でjsonの要素を取り出すサンプル

サンプルコード

<div id="demo"></div>
<script>
var cftObj = { "name":"arkgame", "category":100, "site":"www.arkgame.com" };

for (x in cftObj) { 
  document.getElementById("demo").innerHTML += cftObj[x] + "<br>";
}
</script>

 

Software

Posted by arkgame