Insert value of attribute before each element in the set of elements with jquery?
<p>I would like to use jquery to convert</p>

<pre><code>&lt;div data-expand-label="foo" /&gt;
&lt;div data-expand-label="bar" /&gt;
</code></pre>

<p>into</p>

<pre><code>&lt;p&gt;foo&lt;/p&gt;
&lt;div data-expand-label="foo" /&gt;
&lt;p&gt;bar&lt;/p&gt;
&lt;div data-expand-label="bar" /&gt;
</code></pre>

<p>This is what I thought would work:</p>

<pre><code>$('[data-expand-label]').before('&lt;p&gt;'+$(this).attr('[data-expand-label]')+'&lt;/p&gt;');
</code></pre>

<p>but 'this' doesn't seem to work. Why? and what should I do instead?</p>
