I did not succeeded with your method. However, reading the document more closely, I read: "Create DOM elements on-the-fly".
The solution to my problem is here: http://docs.jquery.com/Core/jQuery# htmlownerDocument
A small example of implementation
Code:
$ (). ready (function () {
$ ( "# mylink"). click (function () {
var mycodehtml = "<p> my para <span id='foo'> <strong> Myfoo </strong> </span> </p>";
var foo = $ ( "# foo", mycodehtml). html ();
alert (foo);
});
});
HTML Code:
<a id = "mylink"> click </a>
Always be persistent
Bookmarks