jQuery replaceWith 객체를 교체하기 > 개발

본문 바로가기
사이트 내 전체검색

개발

jQuery replaceWith 객체를 교체하기

페이지 정보

profile_image
작성자 관리자 (61.♡.24.46)
댓글 0건 조회 4,079회 작성일 15-12-23 15:19

본문

예제)

<div class="container">
  <div class="inner first">Hello</div>
  <div class="inner second">And</div>
  <div class="inner third">Goodbye</div>
</div>

$( "div.second" ).replaceWith( "<h2>New heading</h2>" );

<div class="container">
  <div class="inner first">Hello</div>
  <h2>New heading</h2>
  <div class="inner third">Goodbye</div>
</div>

$( "div.inner" ).replaceWith( "<h2>New heading</h2>" );

<div class="container">
  <h2>New heading</h2>
  <h2>New heading</h2>
  <h2>New heading</h2>
</div>

$( "div.third" ).replaceWith( $( ".first" ) );

<div class="container">
  <div class="inner second">And</div>
  <div class="inner first">Hello</div>
</div>

추천0

댓글목록

등록된 댓글이 없습니다.

Total 389건 12 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
1693245003-28
1683242007-22
1673219001-06
1663180004-02
1653175007-14
1643173005-07
1633138001-15
1623117012-01
1613116011-13
1603096004-28
1593095006-29
1583047005-08
1573047005-16
1563047006-09
1553043007-26
1543017005-08
1533007005-11
1522987003-19
1512984004-30
1502983001-29

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.