-1

非常に単純なはずですが、ジミークリケットの出力しか得られず、すべての名前が li タグにあると予想されます。助けてくれてありがとう。

<ul id="members"></ul>
<script>
var teammembers = [
{"name":"John Doe", "profile":"/img/profile/user1.jpg", "position":"President", "email":"email@example.com", "phone":"242-abcd"},
{"name":"James Bond", "profile":"/img/profile/user2.jpg", "position":"Vice President", "email":"007@example.com", "phone":"242-0007"},
{"name":"Jimmy Cricket", "profile":"/img/profile/user3.jpg", "position":"Vice Cricket", "email":"cricket@example.com", "phone":"242-wxyz"}
];

for (var i = 0; i < teammembers.length; i++) { 
    document.getElementById("members").innerHTML = "<li>" + teammembers[i].name; + "</li>"
}
</script>
4

2 に答える 2