How To Get The Selected Values From Many Options Using Javascript - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › How To Get The Selected Values From Many Options Using Javascript (1029 Views)
| How To Get The Selected Values From Many Options Using Javascript by AloyalNigerian(op): 1:42pm On Oct 21, 2019 |
Hi all, I am working on a personal project that requires me to grab the value selected by the user from the drop-down and use that value to in another place probably to display it as a text.
I was getting errors stating that it can't find the value of undefined. I even tried to see if the eventlistener is working perfectly, and it is. This issue is giving me tough time even though I am using the value on the same page, imagine whta I am going through trying to use a grabbed value in another page. I am so sorry if my question is not clear enough but you can always ask for more clarification. Thanks in advance. |
| Re: How To Get The Selected Values From Many Options Using Javascript by afuye(m): 2:15pm On Oct 21, 2019 |
Drop ur number lemme call u |
| Re: How To Get The Selected Values From Many Options Using Javascript by AloyalNigerian(op): 2:29pm On Oct 21, 2019 |
afuye:Is that your number on your signature? |
| Re: How To Get The Selected Values From Many Options Using Javascript by afuye(m): 4:12pm On Oct 21, 2019 |
Yeah AloyalNigerian: |
| Re: How To Get The Selected Values From Many Options Using Javascript by stanliwise(m): 11:09pm On Oct 21, 2019 |
AloyalNigerian:Here is an example HTML CODE <select id = "ddlViewBy" > <option value ="1" >test1 </option> <option value ="2" selected ="selected" > test2 </ <option value ="3" >test3 </option> </select> Running this code: let target= document.getElementById( "ddlViewBy" ); let value = target.options[target.selectedIndex].value; |
Getting The N-largest Values From A Dataframe With Grouping - Youtube Video • How To Display Uploaded Image In Html Using Javascript • How To Upload Files To Firebase Cloud Storage Using Javascript • 2 • 3 • 4
Top Recommended AI Articles To Read During Lockdown • I Need Help With My Whatsapp Messenger. • Finding Specific User Posts In Chosen Threads - Google Search.
;