http://lemeraldl.tistory.com/admin/entry/post


  1. $('<div id="mydiv"></div>').addClass('newClass').appendTo('body');

If you need to use .append() rather than .appendTo() you can also traverse from the body to #mydiv:

Copy code
  1. $('body').append('<div id="mydiv"></div>').find('#mydiv').addClass('newClass');


'jquery, ajax' 카테고리의 다른 글

제이쿼리 동적 이벤트 ,정적이벤트  (0) 2016.03.09
해당태그 갯수 알아내기  (0) 2016.03.03
동적 html 제어  (0) 2016.02.22
attr()  (0) 2016.02.02
자바스크립트 제이쿼리 this  (0) 2016.01.28
Posted by 이상욱1
,