jQuery: Using Selectors on HTML from an Attribute
<p>I have some HTML that is stored as an attribute on a tag. I can access it in jQuery using </p>

<pre><code>$("input[id$='_myField_hiddenSpanData']").attr("value")
</code></pre>

<p>This looks like this:</p>

<p><code>"&lt;span id='spantest\user' tabindex='-1' contentEditable='false' class='ms-entity-resolved' title='test\user'&gt;&lt;div style='display:none;' id='divEntityData' key='test\user' displaytext='Test User' isresolved='True' description='test\user'&gt;&lt;div data=''&gt;&lt;/div&gt;&lt;/div&gt;&lt;span id='content' tabindex='-1' contenteditable onMouseDown='onMouseDownRw();' onContextMenu='onContextMenuSpnRw();' &gt;Test User&lt;/span&gt;&lt;/span&gt;"</code></p>

<p>I would need the value of the key attribute (test\user). Can I somehow tell jQuery to parse a block of HTML and apply selectors to it? I found I can wrap it into a new jQuery object by wrapping it into another $(): <code>$($("input[id$='_myField_hiddenSpanData']").attr("value"))</code> but I still did not manage to apply a selector on it.</p>

<p>Any hints? And no, sadly I do not control the markup that generates the hidden field.</p>
