I am trying to add a drop down combo box with a drop down mega menu.This is my code
if (trendsmega!="")
{
var companymegaid=document.getElementById("megamenu-mlid-783");
//alert("Found "+trendmegaid.innerHTML);
if (companymegaid!="")
{
var othercompaniesli=document.getElementById("megamenu-mlid-1185");
alert(othercompaniesli.innerHTML);
othercompaniesli.innerHTML="";
othercompaniesli.innerHTML= "<select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select>";
}
}
I am getting the following error
missing ; before statement
[Break On This Error]
....innerHTML= "<select> <option value="volvo">Volvo</option> <option value="saab"...
/drupal/ (line 1329, col 56)
Can anyone help me how to add a combo box with innerhtml using java script.
Make use of
'instead of"in you code.. will remove error.you code will be