I want to submit a form with JavaScript once any child element of a specific unordered list is clicked.
The code could will look somewhat like this but the number of list items can get very long.
<ul id="myList">
<li id="myListItem1">list item 1</li>
<li id="myListItem2">list item 2</li>
<li id="myListItem3">list item 3</li>
</ul>
It will not be possible to add an onclick to every li. Also,I may not be able to attach code to the ul tag so if it is possible to solve without attaching code to the ul tag that would be the best. Unfortunately libs like jquery, mootools etc. may not be used. The id of the UL will always be known and static but the id of the LI's will be unknown since they can differ in amount.