Here is the FIDDLE you can fork and work on
Given a list of
<a href="#" class="iconList" id="myDoc_aaa">...</a>
<a href="#" class="iconListChecked" id="myDoc_bbb">...</a>
<a href="#" class="iconList" id="myDoc_ccc">...</a>
I want to assign the * key to trigger click on each link in turn and ctrl-* to trigger click on all. I do not want to toggle the class, since there is a script that needs to run when the link is clicked
QUESTION: Can you help me with the selectors and what else (data attribute?) to loop over the links one at a time on * and all at once on ctrl-star
So when you
hit *, the first link is triggered (and the script changes the class to iconListChecked),
hit * star again and the second link is triggered (unchecking it),
hit * and the third is triggered,
hit * and we wrap and the first is triggered (unchecking it)
hit ctrl-star and all not-checked links are triggered
FIXED: $(".iconList").trigger("click");
(My fiddle currently only handles the * on the numeric keyboard – I have a separate question for that here)
http://jsfiddle.net/GtXMW/28/