Hi hschulz,

Here is a message I posted a while back in response to a similar question:

Maybe someone else is aware of a workaround to this limitation of IE, but I haven't found one.

... If you take a look at the MSDN reference page for onmouseover [1], you'll see that <option> is not included in the list of elements that this event applies to:

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



[1] http://msdn.microsoft.com/en-us/library/ms536949(VS.85).aspx


It should work in Firefox and Safari, but I suspect you were hoping for a more "universal" solution. Sorry to be the bearer of bad news.

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Nov 10, 2008, at 5:50 AM, hschulz wrote:


Hi,
thanks for your answer, but your code has the same behavior as my
code.

I try to go into details to explain the error.

When you open the dropdown an move the mouse over "option 2" it shows
the valiue of option 2, but when you move the mouse over option 3
(from option 2) it shows the value of option 2 again.



On 4 Nov., 18:55, ricardobeat <[EMAIL PROTECTED]> wrote:
use $("#fooinfo").html( $("#fooselect").val() ); to get the current
selection text!

On Nov 4, 1:36 pm, hschulz <[EMAIL PROTECTED]> wrote:

Hello,

i want to display some additional information in a div, while
selecting an option from a select.
It works so far, except that it always display the previous mouseover
text.

the used html
    <form>
        <div id="fooinfo">qwertz</div>
        <select id="fooselect" name="foo">
            <option value="foo option 2"> option 2</option>
            <option value="foo option 3"> option 3</option>
            <option value="foo option 4"> option 4</option>
            <option value="foo option 5"> option 5</option>
            <option value="foo option 6"> option 6</option>
        </select>
    </form>

and the script
  $(document).ready(function(){
     $("#fooselect option").mouseover(function() {
       $("#fooinfo").html($("#fooselect option:selected").text());
    });
 });

Any suggestions

Thanks
hschulz

Reply via email to