Bug Tracker

Ticket #2337: index.html

File index.html, 1.0 KB (added by ieure, 14 years ago)

Testcase reproducing the issue.

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2          "http://www.w3.org/TR/html4/strict.dtd">
3<!-- $Id: template.html 5 2007-10-11 23:18:37Z stan $ -->
4<html>
5    <head>
6        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7        <meta name="author" content="Ian Eure <[email protected]>">
8        <meta name="copyright" content="© 2008 Buster Marx, Inc">
9        <title></title>
10    </head>
11    <body>
12        <script type="text/javascript" src="jquery.js"></script>
13        <script type="text/javascript">
14$(function()
15  {
16      var html = $('<a href="#" id="foo" class="foo">foo - you should never see this</a> <br> <a href="#" id="bar" class="bar">bar</a>');
17      var nodes = $(html);
18      // Doesn’t work with a simple array of elements.
19      $('#foo', nodes.get()).remove();
20      // Also doesn’t work with the jQuery object matching them.
21      $('#foo', nodes).remove();
22      $('#container').append(nodes);
23  });
24</script>
25        <div id="container"></div>
26    </body>
27</html>