You can use the following onclick action to call a function and use the current 'value' (contents) of the <li>:
Code:
<li onclick="addnext(this.innerHtml);">1</li>
Then in your head section, you'll add the following Javascript:
Code:
function addnext(contents) {
var li = document.createElement('li');
li.innerHtml = contents;
document.getElementById('answer').appendChild(li);
}
I haven't tested this, but it should be a good place to start. I think it should work.
This will copy the <li> item that you click into the "answer" list. Note that it does not do any error correction such as checking how many items you have already added (so you could add 7 items or more, for example).
Bookmarks