For a part of a web app view, the user enters in some data and it is added to an unordered list. For future modification, I want to have each list element selectable for edit and/or review.
HTML:
<div id = "answer_list_container">
<ul id = "answers">
<li id = "answer_1" class = "answer">Answer1 Text</li>
<li id = "answer_2" class = "answer">Answer2 Text</li>
</ul>
</div>
However, I can't get right selector for the list element. I've tried
- $("#answers > li").click(answerSelectionHandler);
- $(".answer").click(answerSelectionHandler);
- $("#answers li").click(answerSelectionHandler);
answerSelectionHandler contains a console.log call that fires on execution of the handler. It is not going off, which suggest a selector issue.