com.aspose.html

Class HTMLSelectElement

    • Constructor Detail

      • HTMLSelectElement

        public HTMLSelectElement(com.aspose.html.dom.DOMName name,
                                 Document doc)

        Initializes a new instance of the HTMLSelectElement class.

        Parameters:
        name - The DOM name.
        doc - The document.
    • Method Detail

      • getType

        @DOMNameAttribute(name="type")
        public String getType()

        The type of this form control. This is the string "select-multiple" when the multiple attribute is true and the string "select-one" when false.

      • getSelectedIndex

        @DOMNameAttribute(name="selectedIndex")
        public int getSelectedIndex()

        The ordinal index of the selected option, starting from 0. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.

      • setSelectedIndex

        @DOMNameAttribute(name="selectedIndex")
        public void setSelectedIndex(int value)

        The ordinal index of the selected option, starting from 0. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.

      • getValue

        @DOMNameAttribute(name="value")
        public String getValue()

        The current form control value (i.e. the value of the currently selected option), if multiple options are selected this is the value of the first selected option.

      • setValue

        @DOMNameAttribute(name="value")
        public void setValue(String value)

        The current form control value (i.e. the value of the currently selected option), if multiple options are selected this is the value of the first selected option.

      • getLength

        @DOMNameAttribute(name="length")
        public int getLength()

        The number of options in this SELECT.

      • setLength

        @DOMNameAttribute(name="length")
        public void setLength(int value)

        The number of options in this SELECT.

      • getForm

        @DOMNameAttribute(name="form")
         @DOMNullableAttribute
        public HTMLFormElement getForm()

        The number of options in this SELECT.

        Returns the FORM element containing this control. Returns null if this control is not within the context of a form.

        Throws:
        DOMException - NOT_SUPPORTED_ERR: if setting the length is not allowed by the implementation.
      • getDisabled

        @DOMNameAttribute(name="disabled")
        public boolean getDisabled()

        The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.

      • setDisabled

        @DOMNameAttribute(name="disabled")
        public void setDisabled(boolean value)

        The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.

      • getMultiple

        @DOMNameAttribute(name="multiple")
        public boolean getMultiple()

        If true, multiple OPTION elements may be selected in this SELECT. See the multiple attribute definition in HTML 4.01.

      • setMultiple

        @DOMNameAttribute(name="multiple")
        public void setMultiple(boolean value)

        If true, multiple OPTION elements may be selected in this SELECT. See the multiple attribute definition in HTML 4.01.

      • getName

        @DOMNameAttribute(name="name")
        public String getName()

        Form control or object name when submitted with a form. See the name attribute definition in HTML 4.01.

      • setName

        @DOMNameAttribute(name="name")
        public void setName(String value)

        Form control or object name when submitted with a form. See the name attribute definition in HTML 4.01.

      • getSize

        @DOMNameAttribute(name="size")
        public int getSize()

        Number of visible rows. See the size attribute definition in HTML 4.01.

      • setSize

        @DOMNameAttribute(name="size")
        public void setSize(int value)

        Number of visible rows. See the size attribute definition in HTML 4.01.

      • getTabIndex

        @DOMNameAttribute(name="tabIndex")
        public int getTabIndex()

        Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.01.

      • setTabIndex

        @DOMNameAttribute(name="tabIndex")
        public void setTabIndex(int value)

        Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.01.

      • add

        @DOMNameAttribute(name="add")
        public void add(HTMLElement element,
                                                       HTMLElement before)

        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:
        element - The element to add.
        before - The element to insert before, or null for the tail of the list.
        Throws:
        DOMException - NOT_FOUND_ERR: Raised if
        before
        is not a descendant of the
        SELECT
        element.
      • remove

        @DOMNameAttribute(name="remove")
        public void remove(int index)

        Remove an element from the collection of OPTION elements for this SELECT. Does nothing if no element has the given index.

        Parameters:
        index - The index of the item to remove, starting from 0.