New course! Every coder should learn Generative AI!
Try a free lesson0
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
4 Answers
+ 5
Write:-
function func(){
//your js code
}
in javascript
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
0
Forget it. I realize that i forgot to write the word function. Silly me.
0
Here's a custom dropdown menu, pls check this out
https://sololearn.com/compiler-playground/WUPX5Qg52T67/?ref=app