Working with Select, Option, and Optgroup in HTML and JavaScript
Published 2020-09-23
Data types for ALL HTML form elements is also discussed.
Code from video: gist.github.com/prof3ssorSt3v3/98e8466a2f2be4f6c53…
All Comments (21)
-
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
-
I corrected my mistake, all good now. Thank you very much!
-
Nice one Steve. The way you explained Js is awesome
-
thank you for being the only resource on the internet that explains it so well
-
Mr Steve I want to say thank you so much for all the videos and the content you produce thank-you so much
-
Thanks much for a next awesome tutorial! I always learn something new watching these ⭐
-
man, rlly ty! I've been searching this since hours, and only u resolved my problem
-
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
-
Super helpful. Thank you!
-
Vers good as always....very smart tip ( [].map.call.....) . Perfect! And as always thanks for teaching!
-
Such a great channel! Already suscribe!
-
Awesome new resolution :)
-
Well explained...
-
thank you Steve nd bless youuuuu
-
Great tutorial, would be great if you can do an complete form submition object with all html elements, radio, checkbox, 👋
-
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)
-
Thanks!
-
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 ..?
-
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