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

  • SEARCH
  • Home
  • 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 8464035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:37:11+00:00 2026-06-10T14:37:11+00:00

How do I display the selected option name in the div above it? If

  • 0

How do I display the selected option name in the div above it? If user has blue selected I want blue to show above.

<div id='text"> selection goes here</div>
<select id="dropdownselect">
<option> Red </option>
<option> White </option>
<option> Blue </option>
</select>
  • 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-06-10T14:37:13+00:00Added an answer on June 10, 2026 at 2:37 pm

    Use the following to get the text of the selected option:

    var select = document.getElementById("dropdownselect");
    var selectedText = select.options[select.selectedIndex].text;
    

    Then, to add the value to the div with id text, use:

    document.getElementById("text").innerHTML = selectedText;
    

    If you want to reflect the selected value every time the option has changed, you need to attach the onchange event to the select, which, combined with the above code results in the following:

    var select = document.getElementById("dropdownselect");
    select.onchange = function () {
      var selectedText = this.options[this.selectedIndex].text;
      document.getElementById("text").innerHTML = selectedText;
    };​
    

    Here’s a working DEMO.

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

Sidebar

Related Questions

I want to put facility to display distance between two places selected by user.
I want to get the currently selected item (text, image, etc) and display in
How to get ItemsControl display items selected Item textbox text value using MVVM pattern?
I have the following: <dd> <select id=contactLocation name=contactLocation size=1> <option value=Online<cfif attributes.contactLocation eq Online>selected</cfif>>Online</option>
How can I display only selected headers in DataGridView control? For example I have
I am trying to display only selected items in list view. public class Mact
I was using this routine, triggered by the Worksheet_Change event, to display a selected
Using VB 6 Once I run the project, How to display a previously selected
I'm trying to display the serial number of the 'recipient' you selected in a
I am trying to display a default value (or even NO value) when selected

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.