Knowledgebase You are here: Support > Knowledgebase > Programming
How to Dynamically Add an Element in Dropdown Menu (Javascript)
function AddItem(text, value){ var opt = document.createElement('option'); opt.text = text; opt.value = value; document.getElementById('menu1').options.add(opt); opt.selected = true;}
Was this answer helpful? YesNo
Add to Favourites Print this Article
Powered by WHMCompleteSolution