Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="myAccordionDiv"></div>
</body>
</html>
 
var myData = [
 {
  label: "erster",
  id: 0,
  Name:"Ein Name"               
},
  {
    label: "zweiter",
    id: 1,
    Name:"Der zweite Name"
  },
  {
    label: "dritter",
    id: 2,
    Name:"Dritter Name"
  }
];
$(function () {
  var myAccordion;
  for (var i=0; i<myData.length; i++) {
    myAccordion += '<h3>'+myData[i].label+'</h3><div>'+myData[i].Name+'</div>';
  }
  $('#myAccordionDiv').html(myAccordion);
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers