1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
  10. * details.
  11. */
  12. package org.w3c.dom.html;
  13. /**
  14. * A selectable choice. See the OPTION element definition in HTML 4.0.
  15. * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
  16. */
  17. public interface HTMLOptionElement extends HTMLElement {
  18. /**
  19. * Returns the <code>FORM</code> element containing this control. Returns
  20. * <code>null</code> if this control is not within the context of a form.
  21. */
  22. public HTMLFormElement getForm();
  23. /**
  24. * Represents the value of the HTML selected attribute. The value of this
  25. * attribute does not change if the state of the corresponding form
  26. * control, in an interactive user agent, changes. Changing
  27. * <code>defaultSelected</code> , however, resets the state of the form
  28. * control. See the selected attribute definition in HTML 4.0.
  29. */
  30. public boolean getDefaultSelected();
  31. public void setDefaultSelected(boolean defaultSelected);
  32. /**
  33. * The text contained within the option element.
  34. */
  35. public String getText();
  36. /**
  37. * The index of this <code>OPTION</code> in its parent <code>SELECT</code>
  38. * , starting from 0.
  39. */
  40. public int getIndex();
  41. /**
  42. * The control is unavailable in this context. See the disabled
  43. * attribute definition in HTML 4.0.
  44. */
  45. public boolean getDisabled();
  46. public void setDisabled(boolean disabled);
  47. /**
  48. * Option label for use in hierarchical menus. See the label attribute
  49. * definition in HTML 4.0.
  50. */
  51. public String getLabel();
  52. public void setLabel(String label);
  53. /**
  54. * Represents the current state of the corresponding form control, in an
  55. * interactive user agent. Changing this attribute changes the state of
  56. * the form control, but does not change the value of the HTML selected
  57. * attribute of the element.
  58. */
  59. public boolean getSelected();
  60. public void setSelected(boolean selected);
  61. /**
  62. * The current form control value. See the value attribute definition in
  63. * HTML 4.0.
  64. */
  65. public String getValue();
  66. public void setValue(String value);
  67. }