Create an unordered list in a textarea

I have googled and searched, but can’t find a way of creating an unordered list in a textarea, in a similar fashion to the function described here:

but with the prompt box for list items, like here at SP forums.

Any help gratefully accepted.

A textarea only contains text, but you can insert newlines and tabs with the text to simulate a list. Make sure the css of the textarea includes white-space:pre (to preserve the whitespace).

var who=document.getElementsByTagName('textarea')[0];
var str='\
\	* '+listarray.join('\
\	* ')+'\

Sorry I don’t think I explained that very well.

I want to have a button that creates a list the same way as if doing it in these forum posts, so that it puts tags inside square brackets that I can use a php regular expression on to turn them into <ul><li>…</li></ul> tags and back again.

The code in the thread I linked to inserted bold, italic, hr and a wink. I need one that makes an unordered list.

I am not sure, if I understand you well. Anyway I had this on my old disc:

<style type="text/css"><!--

<script type="text/javascript">
var d=document;
function tarea(startTag,endTag) {//based on
var txt=d.getElementById('txt');
else if(txt.selectionStart||txt.selectionStart=='0'){//gecko
var zac=txt.selectionStart;
var kon=txt.selectionEnd;
function init(){
var kde=d.getElementById('ovladace');'block';
var hrefy=kde.getElementsByTagName('a');
return false;}}}
function addEvent(obj,evType,fn){
if(obj.addEventListener){obj.addEventListener(evType,fn,true);return true;}
else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}
else{return false;}
addEvent(window,'load',init); //addEvent:thx

<textarea id="txt"></textarea>
<div id="ovladace">
<a href="#" title="h1">h1</a>
<a href="#" title="h2">h2</a>
<a href="#" title="h3">h3</a>
<a href="#" title="h4">h4</a>
<a href="#" title="h5">h5</a>
<a href="#" title="ul">ul</a>
<a href="#" title="li">li</a>

Where you want the round bullet to appear just insert the special characted resembling it. code for special character is &#9679

<textarea rows="6" cols="20">
&#9679 Item1
&#9679 Item2
&#9679 Item3
&#9679 Item4
&#9679 Item5

Just try pasting the above code in HTML file and see if that is what you expect!

Thanks for the help guys. I got it sorted by amending the code in the post I referred to earlier.