set selected value of a select input to another selects option value

roni hassan

I want to set selected value of a select input to another selects option value. when i select a value from first select box, then i want to put that value in to another select box value. but i cant get this value in another select box. i have tried this

html

<body>
    <select>
        <option id="output"></option>
    </select>

    <select id="sel">
        <option>--select--</option>
        <option>amr</option>
        <option>tomar</option>
    </select>
</body>

jquery

$(document).ready(function(){
    $( "#sel" ).change(function() {
        var ww = $( "#sel" ).val();
        alert(ww);
        $( "#output" ).val(ww);
    });
});

demo

roullie

how about trying

$( "#output" ).text(ww);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Set select option 'selected', by value

From Dev

select(name).option(value) selects wrong option?

From Dev

select(name).option(value) selects wrong option?

From Dev

Set an option value as selected

From Dev

Set an option value as selected

From Dev

set selected value of select field if option with that value does not exist

From Dev

set selected value of select field if option with that value does not exist

From Dev

Change value of a input (write into the input) when a option is selected from a select

From Dev

Javascript change input value when select option is selected

From Dev

Disable option values in one select dropdown depending on value selected in another

From Dev

How do I to set selected value in a select option using jquery?

From Dev

How do I to set selected value in a select option using jquery?

From Dev

jquery select option dynamically assign value to another 2 input text

From Dev

Set selected option by option's attribute value

From Dev

Set selected value of select menus

From Dev

How to set the value of select option

From Dev

Set value of Select option in Javascript

From Dev

How to set the value of select option

From Dev

How to copy and paste an html select selected value to other selects

From Java

selected in select option give wrong attribute value

From Dev

Keep the value of an already selected radio/select option

From Dev

Get selected option value from specific select

From Dev

show option value selected in form select

From Dev

How to get the option value of selected in Select dropdown

From Dev

Access value of selected option in <select> element with PHP

From Dev

A selected value of a <select> can modify another <select>?

From Dev

set a $_GET value when option is selected

From Dev

Set selected option value using PHP

From Dev

Several selects - reset remaining selects when option in one select is selected

Related Related

  1. 1

    Set select option 'selected', by value

  2. 2

    select(name).option(value) selects wrong option?

  3. 3

    select(name).option(value) selects wrong option?

  4. 4

    Set an option value as selected

  5. 5

    Set an option value as selected

  6. 6

    set selected value of select field if option with that value does not exist

  7. 7

    set selected value of select field if option with that value does not exist

  8. 8

    Change value of a input (write into the input) when a option is selected from a select

  9. 9

    Javascript change input value when select option is selected

  10. 10

    Disable option values in one select dropdown depending on value selected in another

  11. 11

    How do I to set selected value in a select option using jquery?

  12. 12

    How do I to set selected value in a select option using jquery?

  13. 13

    jquery select option dynamically assign value to another 2 input text

  14. 14

    Set selected option by option's attribute value

  15. 15

    Set selected value of select menus

  16. 16

    How to set the value of select option

  17. 17

    Set value of Select option in Javascript

  18. 18

    How to set the value of select option

  19. 19

    How to copy and paste an html select selected value to other selects

  20. 20

    selected in select option give wrong attribute value

  21. 21

    Keep the value of an already selected radio/select option

  22. 22

    Get selected option value from specific select

  23. 23

    show option value selected in form select

  24. 24

    How to get the option value of selected in Select dropdown

  25. 25

    Access value of selected option in <select> element with PHP

  26. 26

    A selected value of a <select> can modify another <select>?

  27. 27

    set a $_GET value when option is selected

  28. 28

    Set selected option value using PHP

  29. 29

    Several selects - reset remaining selects when option in one select is selected

HotTag

Archive