1 <script> 2 function a(callback) 3 { 4 div1.innerHTML += "a"; 5 callback(); 6 } 7 function b(){ 8 div1.innerHTML+="b"; 9 } 10 11 var div1; 12 window.onload = function () { 13 div1 = document.getElementById("div1"); 14 setTimeout("a(b);", 3000); 15 } 16 </script>