jQuery
[jQuery] 동적 요소 생성 - 두번째 인자 객체형식
힘없는염소
2015. 2. 12. 10:54
//두번째 인자에 객체 형식(key : value) 으로 작성$('<div/>', {"id" : "foo","class" : "box",text: : "test박스","title" : "박스",css: {"background" : "blue","width" : "200px","height" : "200px",},click:function() {$(this).css("background","red");}}).appendTo("body");
반응형