I know that I can react upon focusing an element by .focus
in jQuery. This seems to work for most elements, but it doesn't for an <option>
element. I hoped that, when browsing through a <select>
element with the up/down keys, I could fire a .focus
event for each <option>
, but it doesn't seem to work.
Is this normal behaviour? Is there a workaround? I have created a demo:
http://codepen.io/jmuheim/pen/ONmmqr
My intention is to create a custom <select>
element that looks very fancy using <div>
s, but in the background it's just a plain ol' visually hidden <select>
element, and the fancy <div>
s are simply shown and hidden depending on the <select>
's state.