- 전체
- HTML
- Web Design (웹디자인)
- XE 응용 개발
- wordpress plugin dev
- Javascript & JavaScript Application
- MEAN Stack : full stack javascript
- angular js & ionic framework
- bootstrap
- WebGL, Three.js and Babylon.js
- restful api design
- mobile web
- node.js 응용
- Cloud Service 응용
- 웹 어셈블리 개발 [WASM, WebAssembly]
- 마이크로서비스, MSA (microservice architecture)
- WebGL / WebGPU
- next.js 개발
- micro frontend (마이크로프론트앤드)
- 전자상거래/쇼핑몰
- 서버 클라우드 (aws, azure, google)
HTML [JavaScript] How to clone (and restore) a DOM subtree
2024.05.16 12:00
[JavaScript] How to clone (and restore) a DOM subtree
[Q] I would like to modify a DOM subtree and restore it after a while. How can I save a sub-tree copy aside (to play with the actual subtree)? How can I restore the saved copy afterwards?
[A] If I'm reading this right, then I think all you'd need to do is:
var DomTreeCopy = $('parentElementSelector').clone(true,true);
And then to re-attach the DomTreeCopy (in place of the original):
$('parentElementSelector').replaceWith(DomTreeCopy);
Or to add it to the DOM in addition to the original:
$(DomTreeCopy).insertAfter($('parentElementSelector'));
References:
[출처] https://stackoverflow.com/questions/8702165/how-to-clone-and-restore-a-dom-subtree
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 5 |
[REST API] REST API 이해하기
| 졸리운_곰 | 2018.01.21 | 346 |
| 4 | RESTful API를 설계하기 위한 디자인 팁 | 졸리운_곰 | 2018.01.21 | 528 |
| 3 |
REST API의 이해와 설계 #3 API 보안
| 졸리운_곰 | 2018.01.21 | 431 |
| 2 | REST API 이해와 설계 #2 API 설계 가이드 | 졸리운_곰 | 2018.01.21 | 71276 |
| 1 |
REST API의 이해와 설계 #1-개념 소개
| 졸리운_곰 | 2018.01.21 | 334 |

