So I recently found out that we can get the value of a bullet list through getEventTarget as shown below (credit to this OP).
HTML:
<ul id="testUL">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
JS
function getEventTarget(e) {
e = e || window.event;
return e.target || e.srcElement;
}
var ul = document.getElementById('testUL');
ul.onclick = function (event) {
var target = getEventTarget(event);
alert(target.innerHTML);
};
However, when I wanted to keep track onkeyup, things weren't working as I thought they would be. Here is a fiddle.
What am I doing wrong?