HTML Select, OnChange on <option>?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • @sh

    HTML Select, OnChange on <option>?

    Hi guys,

    As far as I understand it, there is no possible way to add an
    OnSelect/Onchange to an actual <option> within a select tag (to perhaps jump
    to a page or run a DOM command), is this still correct with modern client
    browser advances (obviously taking into account the incompatibiliti es of
    this method with older browsers).

    Cheers, Ash


  • Dietmar Meier

    #2
    Re: HTML Select, OnChange on &lt;option&g t;?

    @sh wrote:
    [color=blue]
    > As far as I understand it, there is no possible way to add an
    > OnSelect/Onchange to an actual <option> within a select tag[/color]

    Use the select element's onchange handler and it's selectedIndex
    property instead.

    ciao, dhgm

    Comment

    • @sh

      #3
      Re: HTML Select, OnChange on &lt;option&g t;?

      "Dietmar Meier" <usereplytoinst ead@innoline-systemtechnik.d e> wrote in
      message news:3d6lkqF6pa 0m8U1@individua l.net...[color=blue]
      > @sh wrote:
      >[color=green]
      >> As far as I understand it, there is no possible way to add an
      >> OnSelect/Onchange to an actual <option> within a select tag[/color]
      >
      > Use the select element's onchange handler and it's selectedIndex
      > property instead.
      >
      > ciao, dhgm[/color]

      Ahhhh ok cool, shame its not a little simpler though and accessible directly
      from the <option> tag.

      Cheers, Ash


      Comment

      Working...