Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 918583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:24:05+00:00 2026-05-15T18:24:05+00:00

This things works perfectly <select name=selectbox onchange=alert(this.value)> But I want to select the text.

  • 0

This things works perfectly

<select name="selectbox" onchange="alert(this.value)">

But I want to select the text. I tried in this way

<select name="selectbox" onchange="alert(this.text)">

It shows undefined.
I found how to use DOM to get text. But I want to do this in this way, I means like using just this.value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:24:06+00:00Added an answer on May 15, 2026 at 6:24 pm
    this.options[this.selectedIndex].innerHTML
    

    should provide you with the “displayed” text of the selected item. this.value, like you said, merely provides the value of the value attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works fine, but I'll want to handle exception if any thing goes
I've used this code https://github.com/johannilsson/android-pulltorefresh It all works perfectly apart from one thing, when
I'm ready to pull my hair out... This works perfectly: $link = mysql_connect('localhost', 'prototype_wp_usr',
I have tried several things but I can't get the MySQL query in my
When I load the page, my scrollview works perfectly, but when I navigate away
I have created a select input via a Ajax request and it works perfectly,
On Internet Explorer my code works perfectly well, but I am using Safari on
I'm trying to get this thing to work in IE (any version - works
every thing work fine locally but this error occurs when I publish it: The
I have developed a control in C#. Among other things this control can popup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.