Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using "this" in JSP?

843836May 26 2005 — edited May 27 2005
<SELECT onchange="window.location.href=this.options
    [this.selectedIndex].value">
<OPTION VALUE="http://www.microsoft.com/ie">
    Internet Explorer</OPTION>
<OPTION VALUE="http://www.microsoft.com">
    Microsoft Home</OPTION>
<OPTION VALUE="http://msdn.microsoft.com">
    Developer Network</OPTION>
</SELECT>
When I choose one of the options in this drop/down list I understand that "onchange" gets "fired".

I thought that selectedIndex took an argument corresponding to the option in the list (selectedIndex(2) is the second option in the drop/down-list). But here "this" is used in front of selectedIndex. Hope someone can explain.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2005
Added on May 26 2005
11 comments
176 views