Bug Tracker

Opened 13 years ago

Closed 13 years ago

#5317 closed bug (invalid)

cannot insert unclosed tag using .html() function (bug?)

Reported by: emil Owned by:
Priority: minor Milestone: 1.3.2
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:



<html> <head>

<script src="jquery.js"></script> <script type="text/javascript">


$("#start").html('<a href="#">pre'); $("#stop").html('after</a>');



</head> <body> <span id="start"></span>-link-<span id="stop"></span> </body> </html>

expect to have "pre-link-after" link but only "pre" is link in FF 3.5.3 and Opera 9.64 nothing is marked as a link on IE 8.0

Change History (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

Nope, it doesn't work that way. The argument to .html() needs to be a valid complete html fragment. Your examle is built as if you're tacking parts of strings together to build html. To learn more, study some jQuery code examples and ask questions on the forums.

Note: See TracTickets for help on using tickets.