Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#4951 closed bug (invalid)

$("<div id='a'>").appendTo("#bar") doesn't work in chrome 2.0

Reported by: Xavi Owned by:
Priority: minor Milestone: 1.3.2
Component: core Version: 1.3.2
Keywords: chrome, xhtml Cc:
Blocked by: Blocking:

Description

$("<div id='foo'>").text("test").appendTo("#bar") does not work on "application/xhtml+xml" pages in chrome 2.0.172.33.

However $("<div id='foo'/>").text("test").appendTo("#bar") work just fine.

Change History (2)

comment:1 Changed 10 years ago by jerone

The second one is the correct one. You should alwasy add the closing slash (/).

comment:2 Changed 9 years ago by dmethvin

Component: unfiledcore
Resolution: invalid
Status: newclosed

As jerone said, the html inside the $() is invalid markup, it either needs a closing slash or a closing tag. The documentation is clear on this.

Note: See TracTickets for help on using tickets.