title: Div with random values that change with time
body: <p>I'm trying to create a div in an HTML page and write random value in it, then, I want the div to refresh itself every X seconds so that the number in it change, but the entire page is not reloaded, just the div.</p>
  
  <p>My idea was that :</p>
  
  <pre><code>&lt;body&gt;
   &lt;div id="people" onload="rand();"&gt; &lt;/div&gt;
  
   &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
  
     &lt;script&gt;
       function autoRefresh_div()
       {
        $("#people").load("load.html");// a function which will load data from other file after x seconds
       }
  
       setInterval('autoRefresh_div()', 0.5); // refresh div after 5 secs
  
      function rand(){
       document.getElementById("people").innerHTML = Math.random();
  }
  
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But nothing appear in my div. I tried to change "Math.random()" with some text but nothings change.</p>
  
  <p>Can someone explain me why?</p>