Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <div id="id01"></div> <script> var myArray = [ { "display": "JavaScript Tutorial", "url": "http://www.w3schools.com/js/default.asp" }, { "display": "HTML Tutorial", "url": "http://www.w3schools.com/html/default.asp" }, { "display": "CSS Tutorial", "url": "http://www.w3schools.com/css/default.asp" } ]; myFunction(myArray); function myFunction(arr) { var out = ""; var i; for(i = 0; i < arr.length; i++) { out += '<a href="' + arr[i].url + '">' + arr[i].display + '</a><br>'; } document.getElementById("id01").innerHTML = out; } </script> </body> <!-- Mirrored from www.w3schools.com/json/tryit.asp?filename=tryjson_function by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:41:00 GMT --> </html>
Result:
Try it Yourself - © w3schools.com