Transform jquery in pure javascript
<p>How can you transfrom this from jquery library into pure javascript?</p>

<pre><code>function appendText(){
    var text = $("#text").val();

    if ( $("#text").val() ){
    var textArea = "&lt;div class='divex'&gt; &lt;li style='list-style-type:none;' id='t"+counter+"'&gt;"+text+"&lt;/li&gt;&lt;button id='b"+
    counter+"'name='t"+counter+"' &gt;edit&lt;/button&gt;&lt;/div&gt;";    
    $("#text").val();
    $("#addedText").after(textArea);
    $("#t"+counter).clear;    
    $("#t"+counter).attr('readonly','readonly');
    $("#b"+counter).bind('click',makeAreaEditable);
    $("#text").val('');
    $('.divex').sortable();                                                 
    counter++;
    }
    else{
    }   
};  
</code></pre>

<p>for the start i tried something like this:</p>

<pre><code>var counter=0;
function appendText(){
    var text = document.getElementById('text');

    if ( document.getElementById('text').value ){
    var textArea = "&lt;div class='divex'&gt; &lt;li style='list-style-type:none;'id='t"+counter+"'&gt;"+text+"&lt;/li&gt;&lt;button id='b"+
    counter+"'name='t"+counter+"' &gt;edit&lt;/button&gt; &lt;/div&gt;";

    var texty = document.getElementById('addedText').appendChild(textArea);
</code></pre>

<p>but i have some problems.</p>

<blockquote>
  <p>I think i didn't atribue the text to the list corectly.. Here is what
  i've got so far:</p>
</blockquote>

<pre><code> var counter=0;
    function appendText(){

        var text = document.getElementById('text').value;

        if ( document.getElementById('text').value ){   
        var div = document.createElement('div');
        div.class = 'divex';
        var li = document.createElement('li');

        div.appendChild(li);
        document.createTextNode(text);

        var bigdiv = document.getElementById('addedText');
        bigdiv.appendChild(text);

        counter++;
        }
        else{
        }   
    };
</code></pre>
