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

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

개발

jQuery replaceWith 객체를 교체하기

페이지 정보

profile_image
작성자 관리자 (61.♡.24.46)
댓글 0건 조회 3,995회 작성일 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 387건 18 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
472280002-20
462072002-21
452144003-04
441634003-11
431918005-04
423460006-15
412790007-16
401859007-17
392206007-24
382475007-24
371395007-27
361704008-03
353775008-10
341509008-11
331784008-18
321772008-19
311555009-07
301739009-08
291600010-02
281604012-05

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.