#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 14 years ago by
comment:2 Changed 13 years ago by
Component: | unfiled → core |
---|---|
Resolution: | → invalid |
Status: | new → closed |
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.
The second one is the correct one. You should alwasy add the closing slash (/).