javascript - How to change the selected item in a Firefox Extension's Menulist? -


I am writing a Firefox extension and I have a list of menus that should be set automatically (on load) It was set before turning it off. It's just being set to the first menu item, I've tried to use setAttribute ('selectedIndex', 1), but it does not work what I'm doing wrong?

Some sample codes:

  & lt; Menulist & gt; & Lt; Menupopup & gt; & Lt; Menuitem label = "default" /> & Lt; Menuitem label = "I want to pick it one" /> & Lt; Menuitem label = "or this one." / & Gt; & Lt; / Menupopup & gt; & Lt; / Menulist & gt;  

Set the selected index property, not the properties.

  document. GetElementById ("mymenulistid"). SelectedIndex = 1;  

After adding it to the document, you will usually need to edit properties for such things.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -