JQuery 새 요소 생성

Jmnote (토론 | 기여)님의 2015년 3월 12일 (목) 21:01 판 (새 문서: ;jQuery 새 요소 생성 ==예시: div== *예제: http://zetawiki.com/jq/create-element.html <script src="//code.jquery.com/jquery.min.js"></script> <script> $(function() { $('#...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
jQuery 새 요소 생성

1 예시: div

<script src="//code.jquery.com/jquery.min.js"></script> <script> $(function() {

   $('#button-add-div').click(function() {

$("

", {
           css: {
               height: "50px",
               width: "200px",
               backgroundColor: "orange",
           },

text: "안녕하세요",

       }).appendTo("body");
   });

}); </script>

<button id='button-add-div'>추가</button> </source>

2 같이 보기

3 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}