Working with Select, Option, and Optgroup in HTML and JavaScript

Published 2020-09-23

All Comments (21)
  • @TheLuckyyy13
    I thought i'd have to look into this select element for quite a while before figuring how to properly use it in javascript. I came across your video and 10 minutes later my problem was solved. Thank you
  • @antrahagure5372
    I corrected my mistake, all good now. Thank you very much!
  • thank you for being the only resource on the internet that explains it so well
  • @mouradelcadi
    Mr Steve I want to say thank you so much for all the videos and the content you produce thank-you so much
  • @cloudkungfu
    Thanks much for a next awesome tutorial! I always learn something new watching these ⭐
  • @erischerub5036
    man, rlly ty! I've been searching this since hours, and only u resolved my problem
  • @timlopes9666
    Wow man ! You do explain things very clearly and good teaching method Keep it up.. Thank you
  • Hello sir, you saved my day. I was stuck on getting the values of all selected options. After 3 days of cursing everything and everyone, I found out that I wrote "select.selectedOption" instead of "select.selectedOptions". 😐 Now everything works 😁 Thanks
  • Vers good as always....very smart tip ( [].map.call.....) . Perfect! And as always thanks for teaching!
  • @F4ILCON
    Great tutorial, would be great if you can do an complete form submition object with all html elements, radio, checkbox, 👋
  • @hamedbahram
    You can also use Array.from() in this case, I find it a bit easier: Array.from(arrayLikeObject) let selected = Array.from(event.target.selectedOptions) let choices = selected.map(option => option.value) to even be more concise, you can send the map function as the second argument to Array.from() Array.from(arrayLikeObject, mapFunctionn) let choices = Array.from(event.target.selectedOptions, option => option.value)
  • I have converted json into table using javascript ..so, I already have the table,th, & td elements..so how can i add dropdown filter to my table ? without adding all the elements staticly ..?
  • @antrahagure5372
    Group project will be successful thanks to your guidance. The only error I get is that "delectedOptions are not defined" . I have then in my HTML file under