$(document).ready(function() { var arr = []; var index = 0; var list = ""; $("#btndis").click(function() { $.each(arr, function() { list += '<li">'+this.id+' '+this.name</li>'; }); $("#section").append(list); }); $("#back").click(function() { //var s = arr[index]; var first = arr.first(); //$("#sec2").innerHTML(<span>first</span>); }) });
$("#back").click(function() { //var s = arr[index]; var first = arr.first(); //$("#sec2").innerHTML(<span>first</span>); })
$("#back").click(function() { if (index < 0) { index = 0; } else { var first = arr[index]; $("#sec2").html('<h5>'+first.id+'</h5>'); index--; } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)