Class Optgroup


@Bean(typeName="optgroup") public class Optgroup extends HtmlElementContainer
DTO for an HTML <optgroup> element.

The optgroup element represents a group of option elements within a select element. It provides a way to organize related options into logical groups, making it easier for users to find and select the desired option. The label attribute provides the group heading.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple option group Optgroup optgroup1 = optgroup("Fruits", option("apple", "Apple"), option("banana", "Banana"), option("orange", "Orange") ); // Disabled option group Optgroup optgroup2 = optgroup("Vegetables", option("carrot", "Carrot"), option("broccoli", "Broccoli") ).disabled(true); // Multiple option groups in a select Select select1 = select("food", optgroup("Fruits", option("apple", "Apple"), option("banana", "Banana") ), optgroup("Vegetables", option("carrot", "Carrot"), option("broccoli", "Broccoli") ) );

The following convenience methods are provided for constructing instances of this bean:

See Also: