jQuery/遅延実行

一秒後に
2秒後に
javascript
$("#box1").on('click',function(){
    //1秒後
  $(this).delay(1000).queue(function(){
     $(this).text("delay(1000)");
  });
});

$("#box2").on('click',function(){
  //2秒後
  setTimeout(function(){
     $("#box2").text("setTimeout");
  },2000);
});