Append text to textarea with javascript
<p>How can I append a list of text into a textarea?</p>

<pre><code>&lt;textarea id="alltext"&gt;&lt;/textarea&gt;

&lt;ol&gt;
    &lt;li onclick="addText(Hello')"&gt;Hello&lt;/li&gt;
    &lt;li onclick="addText(World')"&gt;World&lt;/li&gt;
    &lt;li onclick="addText(Earthlings')"&gt;Earthlings&lt;/li&gt;
&lt;/ol&gt;

&lt;script&gt;
    var Alltext = "";
    function addText(text) {
        Alltext += text
    }
document.getElementById("alltext").value = Alltext;
&lt;/script&gt;
</code></pre>

<p>This is quite inefficient as the list is actually very long. The text added is exactly the value I see on the HTML so there's no need to type it twice right?</p>

<p>Is there any better methods?</p>
