title: How do you split up content into paginated chunks using jQuery?
body: <p>I am breaking up content into chunks using pagination (we have next, previous, current button). </p>
  
  <p>I want to show data in pagination (in other words I want to only 500 characters in one page). Example I have div (having some data ) I want to show that data in pagination(next,previous button disable). If user click first button it show only first 500 character(,previous are disable), then if user click next button than it show next 500 character(previous are enable). Now user can use check next or previous 500 character.</p>
  
  <p>on clicking current button it show all content.
  when I am using this it is not displaying 500 character I used like this
  <a href="http://jsfiddle.net/naveennsit/aD4EF/5/" rel="nofollow">http://jsfiddle.net/naveennsit/aD4EF/5/</a></p>
  
  <pre><code>alert($("#test").html());
  alert($("#test").html().length);
  var currentpage = 0;
  var str = new Array();
  var len = $("#test").html().length;
  /*for(var i = 0; var = len; i++){
  
      str[i] = $("#test").html().substr(0, 500);
  }*/
  
  $("#first").click(function () {
      alert("first");
      var text = $("#test").html().substr(0, 500);
      alert(text);
      $("#test").empty();
      $("#test").val(text); // First time it is not working ?
  
  });
  $("#nxt").click(function () {
      alert("nxt");
  });
  
  $("#pre").click(function () {
      alert("pre");
  });
  </code></pre>