2
I’m trying to add an option to a select:
function add(){
var opt = document.createElement("option");
opt.value = "0101";
opt.text = "foo";
}
That code works.
My question is why when I remove double quotes from the line where I pass the value to the option the value of it becomes 65 ?
I know it doesn’t answer the question, but Forms values are always strings, so they should be set in quotes anyway.
– Gê Bender
I agree with you in parts, because if this code were written directly html you would be right, but this is being done in javascript.
– Felippe Tadeu