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 7577217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:07:40+00:00 2026-05-30T17:07:40+00:00

i have select input having id slt i want to pick innertext of value

  • 0

i have select input having id “slt” i want to pick innertext of value and assign its text to another div. i have a code from which i am getting its value now i want to make a onchange function when user change input value, the value should be assign to another div.

jQuery code:

var ch= $('#sltnew option:selected').html();
$('#catch').html(ch);

HTML:

<div id="catch">select city</div>;

<select name="sltnew" id="slt" onchange="change ()">
    <option value="opt1">hello</option>
    <option value="opt2">Option 2</option>
    <option value="opt3">Option 3</option>
    <option value="opt4">Option 4</option>
    <option value="opt5">Option 5</option>
    <option value="opt6">Option 6</option>
    <option value="opt7">Option 7</option>
    <option value="opt8">Option 8</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-05-30T17:07:41+00:00Added an answer on May 30, 2026 at 5:07 pm

    Try this:

    // on load
    var ch = $('#sltnew option:selected').html();
    $('#catch').html(ch);
    
    // on change
    $("#slt").change(function() {
        $('#catch').html($(":selected", this).html())
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this select input in my form that I want to access via
I have an hidden input field with a value, <form> <input type=hidden value=product/> <select
I am having problems with the following code: I have n numbers of select
I am having trouble with generating text fields dynamically. I have a select box
I have a form with a select box and three text input boxes. When
I have a form having select Input with some options in the drop down
I have this select input with simple_form: <%= f.input :board, :collection => Board.where(:user_id =>
I have a select input: f.select :category_id, nested_set_options(Category, @categories) {|i| #{'-' * i.level} #{i.name}
I have a html element (like select box input field) in a table. Now
I have a form in a .html files where input/select box looks like this

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.