I have the following code snippet (Not self written, obtained from Add a list item through javascript)
Demo of relevant Script here: http://jsfiddle.net/Gmyag/
The HTML Portion:
First name:
<input type=text id=firstname>
<br>
<p>Your first name is: <b id='boldStuff2'></b>
</p>
<p>Other people's names:</p>
<ol id=demo></ol>
<input type='button' onclick='changeText2()' value='Submit' />
The JS portion:
var list = document.getElementById('demo');
function changeText2() {
var firstname = document.getElementById('firstname').value;
document.getElementById('boldStuff2').innerHTML = firstname;
var entry = document.createElement('li');
entry.appendChild(document.createTextNode(firstname));
list.appendChild(entry);
}
And need to know how one would add a dynamic button that appears next to each entry, say, an X mark that once clicked would remove that entry from the array and from the list.
Any and all help is greatly appreciated.