/// <summary> /// Adds an element to the collection of option elements for this select element. /// </summary> /// <param name="option">The element to be added.</param> /// <param name="before">An element of the collection, should be inserted before.</param> public void Add(HtmlOptionElement option, HtmlOptionElement before = null) { if (before == null) { AppendChild(option); } else { InsertBefore(option, before); } }
/// <summary> /// Adds an element to the collection of option elements for this select element. /// </summary> /// <param name="option">The element to be added.</param> /// <param name="index">The index, representing the item should be inserted before.</param> public void Add(HtmlOptionElement option, long index) => InsertBefore(option, Options[index]);