Bug Tracker

Modify

Ticket #5917 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

replaceWith is not working as mentioned in the api doc

Reported by: neerajdotname Owned by:
Priority: major Milestone: 1.4.2
Component: manipulation Version: 1.4.1
Keywords: Cc:
Blocking: Blocked by:

Description

replaceWith is working fine when only one element is replaced.

When more than one elements are to be replaced then all the elements are replace with a single element.

<h2>one</h2> <h2>two</h2> <h2>three</h2>

$('h2').replaceWith('<span>lab</span>');

Above code will replace all the three h2 with a single span.

Change History

comment:1 Changed 3 years ago by neerajdotname

comment:2 Changed 3 years ago by neerajdotname

comment:3 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed
  • Component changed from unfilled to core

I added in the tests but they're all working.  http://github.com/jquery/jquery/commit/532bec4c694532acbe2e14ad3b6ff72a4da90be0

A previous commit must've fixed this!

comment:4 Changed 3 years ago by john

  • Version changed from 1.4 to 1.4.1
  • Milestone changed from 1.4.1 to 1.4.2

comment:5 Changed 3 years ago by john

  • Component changed from core to manipulation

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.