How to implement inbuilt Bullet List within TextArea using Javascript?
<p>i have used following code form jsfiddle.net but it have one bug that if we press Enter Key + Character keys very swiftly it generate following out put. </p>

<p>//Javascript Code</p>

<pre><code>function onfoc()
{
if(document.getElementById('todolist').value =="")
{
    document.getElementById('todolist').value +='• ';
}
}

function bulletOnEnter(){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){

    document.getElementById("todolist").value +='• ';

}
var txtval = document.getElementById('todolist').value;
if(txtval.substr(txtval.length - 1) == '\n'){
    document.getElementById('todolist').value = txtval.substring(0,txtval.length - 1);
}
}
</code></pre>

<p><a href="http://i.stack.imgur.com/22hgf.jpg" rel="nofollow">Output Image</a></p>