Append before parent after getSelection()
<p>I have one question. I try to develop a little WYSIWYG editor. </p>

<p>I would like create a <code>&lt;h1&gt;</code> button which allows me to generate a <code>&lt;h1&gt;</code> title (by clicking on button after text selection in <code>&lt;p&gt;</code> element).</p>

<p>I obtain the selection with <code>window.getSelection()...</code>. But now, I would like to put my <code>append("&lt;h1&gt;my text selected&lt;/h1&gt;")</code> just before the <code>&lt;p&gt;</code>. It’s my problem, because my <code>&lt;p&gt;</code> elements don’t have <code>id</code> or <code>class</code>. So do you know a means to put my append just before the <code>&lt;p&gt;</code> where my text has been selected?</p>

<p>I don’t know if with my bad English you’ll understand me!</p>

<p>Thanks very much for your help. </p>
