Notice
Recent Posts
Recent Comments
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

하이오리

[jQuery] 요소 바꾸기 - replaceAll(),replaceWith() 본문

jQuery/자주쓰는함수

[jQuery] 요소 바꾸기 - replaceAll(),replaceWith()

하이오리 2013. 6. 4. 21:17

replaceAll();

바꿀 요소를 선택한 요소에 바꾼다.

$("replaceAll success!").replaceAll($("target"));

 

replaceWith();

선택한 요소를 다른 요소로 바꾼다.(이것만 쓰면 되겠다)

$(document).ready(function() {

$("#target").replaceWith("replaceWith success!");

});

<div id="target"></div>