I have a bunch of items being created dynamically that a user can select. In which case the class "selected" is added.

```
<li id="test1" class="myElement selected"></li>
<li id="test2" class="myElement"></li>
<li id="test3" class="myElement"></li>
<li id="test4" class="myElement selected"></li>
<li id="test5" class="myElement selected"></li>
<li id="test6" class="myElement"></li>

```

How can I get the id's of all the elements that have the "selected" class onclick?