function addOption(selectbox, val, txt){
......
}
addOption(list, "Cars", "Cars");
I need to add this in front of the text of the function:
So that there is space coming in before the option text...Never mind what it is for, it is just confusing... I just don't know how to insert it into the js code.
If I do it like this:
addOption(list, "Cars", " Cars");
Then the
comes into the text, so it gets displayed for the users.
However I need it to be interpreted as "space"...
If you don't 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);
}