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

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

개발

jQuery replaceWith 객체를 교체하기

페이지 정보

profile_image
작성자 관리자 (61.♡.24.46)
댓글 0건 조회 4,005회 작성일 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건 3 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
3475152012-20
3465016011-27
3455015003-09
3445010001-03
3434970006-04
3424942007-04
3414915001-11
3404912004-24
3394896004-09
3384860005-13
3374836001-31
3364834005-29
3354775005-07
3344758007-29
3334745011-11
3324737010-10
3314724007-22
3304715004-25
3294703005-19
3284690010-02

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.