Modify ↓
Ticket #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: | |
| Blocking: | Blocked by: |
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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