What's the effectiviest way of creating an element with multiple attributes and appending it to another element and have it available as a variable??
<p>I wonder what's the effectiviest way of creating an element with <code>id='id' class='class'  attr='attr' ..</code> and appending it to another element and have it available as a variable?</p>

<p>So far I can do it with one line of code. But it requires a new set of javascript framework. I just want to make sure that there is no effectivier way first. </p>

<p>My solution is to create a javascript framework, which got the following syntax:</p>

<p><code>var variable = elementTagAppend/Prepend/After/Before('JQuerySelector', elementToAppend/Prepend/After/BeforeTo);</code></p>

<p>For instance, if I want to create an div element with id='id', class='class', attr='attr' and append it to an another element called "another"</p>

<p><code>var variable = divAppend('#id.class[attr = "attr"]', another);</code> Very effective right?</p>

<p>Or if I want to prepend a form element with id='inputForm', class='inputForms':</p>

<p><code>var variable = formPrepend('#inputForm.inputForms', another);</code></p>
