jQuery: The Write Less, Do More JavaScript Library

select <option> not catching mousedown event in IE and Chrome

View: New views
3 Messages — Rating Filter:   Alert me  

select <option> not catching mousedown event in IE and Chrome

by sso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This is the code I am using to test this.  In FF and Op. When I click
on an option in the select box, the alert pops up.  In IE and Chrome,
it doesn't seem to catch it at all.

     $('.clickopt').mousedown(function(){
          alert("test");
     });

Re: select <option> not catching mousedown event in IE and Chrome

by Karl Swedberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

don't know about Chrome, but IE doesn't support onmousedown for option elements:


Applies To

     A, ADDRESS, APPLET, AREA, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, CUSTOM, DD, DFN, DIR, DIV, DL, document, DT, EM, EMBED, FIELDSET, FONT, FORM, hn, HR, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, OL, P, PLAINTEXT, PRE, RT, RUBY, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, Element Constructor, HTMLDocument Constructor

No OPTION listed.

--Karl

____________
Karl Swedberg




On Jul 2, 2009, at 9:59 AM, sso wrote:


This is the code I am using to test this.  In FF and Op. When I click
on an option in the select box, the alert pops up.  In IE and Chrome,
it doesn't seem to catch it at all.

    $('.clickopt').mousedown(function(){
         alert("test");
    });


Re: select <option> not catching mousedown event in IE and Chrome

by hydrarulz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You need to catch the onchange event on the <select> element

On Jul 2, 4:59 pm, sso <strongsilent...@...> wrote:
> This is the code I am using to test this.  In FF and Op. When I click
> on an option in the select box, the alert pops up.  In IE and Chrome,
> it doesn't seem to catch it at all.
>
>      $('.clickopt').mousedown(function(){
>           alert("test");
>      });