Bug Tracker

Modify

Ticket #10841 (closed bug: invalid)

Opened 19 months ago

Last modified 19 months ago

.last() doesn't update

Reported by: iirineu@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:

Description

HTML

<html>
<input type="text" name="1" id="1" />
<input type="text" name="2" id="2" />
</html>

Javascript

$("html input").last().css("border", "1px solid red");
$("html").append('<input type="text" name="3" id="3" />');
$("html input").last().css("border", "1px solid red"); //nothing happens

Change History

comment:1 follow-up: ↓ 2 Changed 19 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

You've appended your input element to the html element, which is invalid. Did you mean body perhaps?

comment:2 in reply to: ↑ 1 Changed 19 months ago by anonymous

Replying to dmethvin:

You've appended your input element to the html element, which is invalid. Did you mean body perhaps?

Yes, my mistake. Should be:

<html>
<body>
<input />
<input />
</body>
</html>

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.