Skip to main content

Bug Tracker

Side navigation

#5317 closed bug (invalid)

Opened October 01, 2009 11:12PM UTC

Closed October 02, 2009 12:44AM UTC

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:
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

Attachments (0)
Change History (1)

Changed October 02, 2009 12:44AM UTC by dmethvin comment:1

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.