Class Output


@Bean(typeName="output") public class Output extends HtmlElementMixed
DTO for an HTML <output> element.

The output element represents the result of a calculation or user action. It is typically used to display the result of form calculations, such as the sum of two numbers or the result of a mathematical operation. The for attribute can be used to associate the output with specific form controls that contribute to the calculation.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple output element Output output1 = output("0") .name("result"); // Output with form association Output output2 = output("0") .name("sum") ._for("num1 num2"); // Output in a calculation form Form calcForm = form( input("number").name("num1").id("num1").value("0"), span(" + "), input("number").name("num2").id("num2").value("0"), span(" = "), output("0").name("sum")._for("num1 num2") ); // Output with styling Output output3 = output("Ready for calculation") .name("display") ._class("result-display");

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

See Also: