jquery - How can I refresh a Div in javascript instead of the whole page? -


The code below works and is good, but I'm going to transfer it to a DURUP page and I Want to refresh "DIV" instead of the whole page can anyone help? Thanks!

  document.write ("
gt; & lt; h1 & gt; Speaking time worksheets & lt; / h1 & Gt; & lt; / center & gt; & lt; div class = 'box_member_holder'> ") var nums = [01.02,03,04,05,06,07,08,0 9,10, 11,12]; Var gen_nums = []; Function in_array (array, el) {for (var i = 0, j = array.length; i & lt; j; i ++) if (array [i] == el) return true; return false; } Function get_rand (array) {var rand = array [Math.floor (Math.random () * array.length)]; If (! In_array (gen_nums, rand)) {gen_nums.push (rand); Return rand; } Return get_rand (array); } (Var i = 0; i & lt; 9; i ++) {document.write ("& lt; div class = 'box_numbers' gt;
What is this time?" + Get_rand (nums) + "& lt; / center & gt; "); }

Thanks!

Create a function that ends through all your dynamically created div Elements:

  function refresh devs () {$ ('. Box_number & gt; center'). Each (function () {$ (this) .html ('What is this time?' + Get_rand (nums));); }  

Comments