I have been working on a project and have iterations of it (ensuring that each worked with its intended functionality before moving on).
As I went to start working today, a key part of my functionality has stopped working; even worse, opening up previous iterations (which have NOT been modified) also do not work for this feature.
I have not edited the code whatsoever.
The relevant code is here:
window.onload = function(){ // test for clicks on list
var ul = document.getElementById("list");
ul.onclick = function(event){
var target = getEventTarget(event);
//do stuff
}
}
and the function getEventTarget
function getEventTarget(e){
e = e || window.event;
return e.target || e.srcElement;
}
It is not doing anything with the click event (not producing any console logs). As I reiterate, it was working perfectly fine prior to now.
I have restarted my computer, completely cleared the browsers history (Chrome), tried the code on another computer (which it also was previously working on, to no avail), and tried different browsers.
What do I do?
EDIT:
HTML:
<div class="mylist hidden">
<div class="container">
<div id="addplaylist"><a><span class="glyphicon glyphicon-adjust"></span>
<span>Here's my List</span>
</a></div>
<br />
<ul id="list">
</ul>
</div>
</div>