0

I would like to know if there is an event in Firefox that opens an html select.

In Chrome 'mousedown' works, but in Firefox it doesn't.

My code is something like

event = new MouseEvent('mousedown',{
            'view': window
            });
$(selector).dispatchEvent(event);

There are many similar questions but I wasn't able to come up with a definitive answer...

marcosh
  • 8,780
  • 5
  • 44
  • 74
  • Dont you want to use jQuery? – Alvaro Jan 16 '14 at 17:33
  • What about if you will save and trigger boolean flag on event to onclick, and if flag is true, select is opened, else closed? – test1604 Jan 16 '14 at 17:37
  • 1
    He's not trying to trigger an event when the select is opened, he wants to open the select as if the user clicked on it. Anyway, it's not possible. – nderscore Jan 16 '14 at 17:41
  • It can only be done in Chrome. Your alternative is to use a full js implementation of a combo box providing this behavior. – Joan Charmant Jan 16 '14 at 20:53
  • if it is not possible, my next question (or curiosity) wuold be: what's the cause that makes the select open in Firefox? – marcosh Jan 16 '14 at 21:25

0 Answers0