How To Get Selected Option Value From Drop Down List Using JavaScript [ with source code ]

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 86

  • @Juzzyjuzzy
    @Juzzyjuzzy 2 года назад +9

    You could also do “list.selectedIndex” if you are looping or using conditional statements.
    For example:
    If(list.selectedIndex === 1){
    …… //do something
    }
    Selected index allows to those option elements to behave like indexed nodes.

  • @nic00la1
    @nic00la1 Год назад +2

    THANK UU VERY MUCH MY BROTHER! I was struggling in this problem all day alone :/ before I found u!! Thank u bro

  • @BOBTHECORN
    @BOBTHECORN 9 месяцев назад +2

    OMG THANK YOU SO MUCH

  • @easydater
    @easydater 6 лет назад +6

    only few voiceless videos work and this is one of them

  • @emekahastings5900
    @emekahastings5900 3 года назад +3

    I have been looking for this for dayssss now

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      do you know how to get the selected text description also??

  • @cameron8065
    @cameron8065 4 года назад +5

    Just what I was looking for. Great video. Thanks!

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      do you know how to get the selected text description also??

  • @juanfelipedelgadillo9835
    @juanfelipedelgadillo9835 3 года назад

    this is justly that i needed, you´r the better. greetings from Colombia :3

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @UkraineFront
    @UkraineFront 3 года назад +1

    This was very helpful! Congratulations! 😀👏👍

  • @fabiangrill3141
    @fabiangrill3141 4 года назад +3

    You just saved my life😂

  • @tustinnrent8502
    @tustinnrent8502 3 года назад +1

    great! how do you get the selected text description also??

  • @KotammaSurabhi-s2c
    @KotammaSurabhi-s2c Год назад

    once dropdown value selected then the selected value should be hide in dropdown is it possible?

  • @romanoshiliarhopoulos5763
    @romanoshiliarhopoulos5763 2 года назад +1

    thank you you saved me

  • @onkkkar
    @onkkkar 4 года назад +1

    thanks for making this video. it helped me.. :)

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      do you know how to get the selected text description also??

  • @amlslmn4573
    @amlslmn4573 3 года назад

    Intéressant, merci mec :)
    (ton menu contextuel de la souris t'a trahis sur ta langue 😛)

  • @surajlalla4953
    @surajlalla4953 6 лет назад +1

    Hey can u please tell me how to create cookies or sessions of the selected value in the select tag so that I can use the selected value on the next page

  • @MFaiZ007MF
    @MFaiZ007MF 4 года назад +2

    sir, can i ask something, i hope you can help me.
    i want function like this (get value from each selected drop-down)
    BUT the value i needed is ID in MYSQL for each selected item.

    • @MultiMaN95
      @MultiMaN95 4 года назад

      same problem

    • @hazirahmusa2840
      @hazirahmusa2840 4 года назад

      @@MultiMaN95 do you guys got it?

    • @MultiMaN95
      @MultiMaN95 4 года назад

      @@hazirahmusa2840 yes found a way to implement mine by using anchor tag

    • @hazirahmusa2840
      @hazirahmusa2840 4 года назад

      @@MultiMaN95 can you share the code? thank youu

    • @MultiMaN95
      @MultiMaN95 4 года назад

      @@hazirahmusa2840 will do a short video this Saturday and upload , after i will send you link

  • @iqbaldwisetiadani4494
    @iqbaldwisetiadani4494 6 лет назад +2

    you da real hero bro..thanks!

  • @khemendrabhardwaj2552
    @khemendrabhardwaj2552 2 года назад +1

    how do i use body-parser to select options from select tag

  • @hellfire1637
    @hellfire1637 2 года назад

    Lets say i select Java, how can i make it that when the page is refresh, it shows Java instead of Javascript

  • @xtracodez
    @xtracodez 5 лет назад +4

    Really needed this.Thanks :)

  • @truthhammer69
    @truthhammer69 8 месяцев назад

    If only I could now pass that value in ejs template

  • @idrissbouzaidi4714
    @idrissbouzaidi4714 3 года назад

    Thank you with all my heart

  • @CSB_KeerthanaA
    @CSB_KeerthanaA 2 года назад

    Is it possible to use hover on the select tag??

  • @vivoichsan1208
    @vivoichsan1208 2 года назад

    sir ilike your code . I have a questiion... How is the code . When your combo box have a value for the example .. i choose php .. the price of php $300... Like that... How is the code

  • @tedbobit2762
    @tedbobit2762 5 лет назад +1

    Thanks very much , super tutorial !!!!!

  • @tothebest3671
    @tothebest3671 4 года назад +1

    Thank you so much 💕

  • @flipflop6632
    @flipflop6632 6 лет назад

    Hi when all selected items are in $options like in two sides jquery plugins how to get the values of $options please?

  • @hemantagrahari4298
    @hemantagrahari4298 3 года назад

    Sir apke video c kafi kuch sekha hu sir apse request h sir please ek video m ap starting c bnaiye registration page k bare m
    And fields add kariye
    Name
    Password
    Confirm password
    State
    Gender
    Address
    Mail
    Number
    Qualification with multiselect
    Images uploaded
    Ipaddrres
    Time and date
    Date of birth
    With validation
    Itne video ap bnate ho please ek video is par b ap bnaiye help ho jayegi meri bahut please sir aise koi video pure RUclips m n h
    In php m btaiye ap using MySQL

  • @paulopara5261
    @paulopara5261 3 года назад

    Thank you very much.

  • @shivaypatel1358
    @shivaypatel1358 3 года назад

    Can i print selected list value into my php variable?

  • @pushkarraj3908
    @pushkarraj3908 4 года назад +1

    thanks buddy

  • @frontendadarsh
    @frontendadarsh 5 лет назад +1

    Awesome bro

  • @ChaminduWeerasinghe
    @ChaminduWeerasinghe 6 лет назад +1

    Thank you 🙏 ... it is helpfull

  • @chrysafinE97
    @chrysafinE97 6 лет назад +1

    amazing video, ur awesome! thanks sooo much

  • @PhilMinecraft
    @PhilMinecraft 4 года назад

    getSelectValue is not difined
    Pls fix it?!

  • @LutherJohnJomaya
    @LutherJohnJomaya 6 лет назад

    how about get only the value and that would be an array of values

  • @reinaogo7161
    @reinaogo7161 4 года назад +1

    thanks

  • @samueltorres2485
    @samueltorres2485 7 лет назад +1

    Can you please do this same tutorial (with a dropdown select list) but make an image display in the browser??

    • @PhilMinecraft
      @PhilMinecraft 4 года назад

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      @@PhilMinecraft do you know how to get the selected text description from dropdown also??

    • @PhilMinecraft
      @PhilMinecraft 3 года назад

      @@tustinnrent8502 wdym?

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      ​@@PhilMinecraft for instance, how to get "JavsScript" instead of "js," or "Csharp" instead of "c#"? how to get that description captured if we need to use it further? thank you!

    • @tustinnrent8502
      @tustinnrent8502 3 года назад

      @@mistake9057 yes, that's what I ended up doing!

  • @viniciusm.m.7822
    @viniciusm.m.7822 2 года назад

    thanks!

  • @tisajoseph9650
    @tisajoseph9650 3 года назад

    Thank you

  • @kriziacarissepangan1590
    @kriziacarissepangan1590 2 года назад

    Thankyouuuuu!

  • @Павел-ф4щ9ъ
    @Павел-ф4щ9ъ 3 года назад

    Спасибо! Помог.
    Полезное видео.

  • @noeldas7309
    @noeldas7309 6 лет назад

    can you tell how to do in codeigniter framework??

  • @MatthewEmillio
    @MatthewEmillio 7 лет назад +1

    awesome, thanks !

  • @betoayza6620
    @betoayza6620 5 лет назад +1

    Really cool

  • @ajithkumarpanja3714
    @ajithkumarpanja3714 7 лет назад +2

    super!!!

  • @ajithraj1206
    @ajithraj1206 5 лет назад

    How to do that on webpage itself !

    • @mini_rajnikant3616
      @mini_rajnikant3616 4 года назад +1

      Put a div tag in the html page and then instead of printing in the console print the value inside the div tag

  • @ayshbabar
    @ayshbabar 2 года назад

    Is this video really muted, or am I the only one who can't hear anything?

  • @besselykiffer
    @besselykiffer 5 лет назад +1

    merci

  • @deepakmishra1875
    @deepakmishra1875 6 лет назад

    not working

  • @shaikhanuman8012
    @shaikhanuman8012 7 лет назад

    very tqqqss

  • @devvijay7845
    @devvijay7845 4 года назад

    Awaj nhi arhi h

  • @Zen-lz1hc
    @Zen-lz1hc 4 года назад

    How to talk ?

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @devrajraushan5125
    @devrajraushan5125 Год назад +1

    thank you bro

  • @skajharuddin1449
    @skajharuddin1449 2 года назад +1

    Thank you

  • @nabilakhansah
    @nabilakhansah 2 года назад

    Thank you very muchh

  • @karinorestiso
    @karinorestiso 6 лет назад +1

    super thanks!!!!

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"

    • @INKILU
      @INKILU 2 года назад

      hjdjvccbcbcbbc

  • @amalbekegamberdiyev
    @amalbekegamberdiyev 2 года назад

    Can I ask you question?.If I want "When I click Php message send next html file"