Help with select(solved) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help with select(solved)

I am trying to change the text according to what is selected but it isn’t working. Can someone please tell me why? https://sololearn.com/compiler-playground/W2I5423R2hl0/?ref=app

18th Mar 2024, 4:42 AM
Zvi
Zvi - avatar
4 Answers
+ 5
Write:- function func(){ //your js code } in javascript
18th Mar 2024, 4:57 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
0
I don’t understand, i did write the js code in the js section. If you look it says func(){ let x=document.querySelector("#select").value; let p=document.querySelector("#p"); p.innerHTML=x; } I must be doing something wrong
18th Mar 2024, 5:05 AM
Zvi
Zvi - avatar
0
Forget it. I realize that i forgot to write the word function. Silly me.
18th Mar 2024, 5:07 AM
Zvi
Zvi - avatar
0
Here's a custom dropdown menu, pls check this out https://sololearn.com/compiler-playground/WUPX5Qg52T67/?ref=app
18th Mar 2024, 9:31 PM
IAmSupreme
IAmSupreme - avatar