Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
Description
code:
<html> <head>
<script src="jquery.js"></script> <script type="text/javascript">
$(document).ready(function(){
$("#start").html('<a href="#">pre'); $("#stop").html('after</a>');
});
</script>
</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
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.

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.