function addOption(selectbox, val, txt){ ...... } addOption(list, "Cars", "Cars");
I need to add this before the function text:
So, there is a space before the option text ... It doesnβt matter what it is for, itβs just confusing ... I just donβt know how to insert it into js code.
If I do it like this:
addOption(list, "Cars", " Cars");
Then included in the text, so it is displayed to users. However, I need this to be interpreted as "space" ...
If you do not understand, let me know ...
How can i do this? Quotes, double quotes, etc.?
thanks
UPDATE:
function addOption(selectbox, value, text, cl ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; if (cl==1){ optn.className = "nav_option_main"; } selectbox.options.add(optn); }
user188962
source share