I need help on how I could simulate a keypress/keydown, specifically spacebar when clicking on a label. I need to do it with only javascript or mootools, no jquery please.
I'm using a script I found for a dropdown with multiselect. What I need to do is that when they select one of the options in the dropdown this one is selected as well on the checkboxes on the bottom. I added an event change in order to do this, but it's not working correctly since the script for the multiselect is moving the inputs into an <li>
tag and adding a label. (Here is the link)
I already tried adding an event click to the <li>
and label without luck. I also tried to add a fireEvent to the label and li. If you click the checkbox on the dropdown the event works correctly or if you hit spacebar. So I've run out of solutions to this problem. Any ideas? I would really appreciate any tips on how to do this.