thebigdir > References > DOM2 Reference

add (method )

Owning interface and usage:  
HTMLSelectElement.add(element, before)

Member of these other interfaces:  
none

Description:  
Add a new element to the collection of OPTION elements for this SELECT. This method is the equivalent of the appendChild() method of the Node interface if the before parameter is null. It is equivalent to the insertBefore() method on the parent of before in all other cases. This method may have no effect if the new element is not an OPTION or an OPTGROUP.

Parameters:  
HTMLElement element  -  The element to add.
HTMLElement before  -  The element to insert before, or null for the tail of the list.

Returns:  
nothing

Exceptions:  
DOMException NOT_FOUND_ERR
Raised if before is not a descendant of the SELECT element.


Example:
Source:
   <SELECT id="component-select">
      <OPTION value="Component_1_a" selected="selected">Component_1</OPTION>
      <OPTION value="Component_1_b">Component_2</OPTION>
      <OPTION value="Component_2_a">Component_3</OPTION>
      <OPTION value="Component_2_b">Component_4</OPTION>
   </SELECT>
JavaScript:
  function addOption() {
    var el = document.createElement('OPTION');
    el.setAttribute('value', 'Component_3');
    el.appendChild( document.createTextNode('some_component_to_add') );
    var main = document.getElementById('component-select');
    main.add(el, null);
  }
Try it:  
See it:



_____________________________________________
Reference Search | Sitemap | Surf Clothing Glossary       thebigdir | internet users




Related sites:

 

Luxury designer linens bed sheets bedding

 

you got to check these guys out here: search engine optimization emarketing seo and Search Engine Marketing. It is exactly what you need.

 

 

visit Quiksilver Surf Camps and Surf School and book a surf lesson.

And for the girls you can visit this site Roxy Surf Camps and Surfing School to learn more about surfing and take a class as well.

 

If you want to see a good surf contest visit this site: Billabong Pro Pipeline Masters Surfing Contest 2007. You'll be glad you did.

Billabong Pro Pipe Pipeline Masters 2007 Surf Contest This website is one that you have to see at boardshort superstore quiksilver billabong swim suit hurley roxy quicksilver volcom

 

This is a must go surfing event: Eddie Would Go Aikau Big Wave Invitational 2007 Quiksilver Surf fans from around the world will be watching this event and buying the Eddie Would Go Surf Clothing.

 

 

Check out these online surf shop websites. I like the BOARDSHORTSUPERSTORE.COM website the best but there are others. There is also the BUYBOARDSHORTS.COM website that has a good selection as well. And if you want to see a great selection of shirts, BUYSURFTEES.COM is a good site and I think each one of the websites has a great selection.