jquery 检测元素是否存在

  1. if ($('#myDiv).length) {  
  2.     // your code  
  3. }

  4.  Simple, but not obvious.
posted @ 2008-12-25 17:29  looping  阅读(654)  评论(0编辑  收藏  举报