/ LJCPHPCodeDoc / LJCTextBuilderLib / LJCTextBuilder / End


Parameters
name - The element name.
textState - The current text state values.
addIndent - _ParamSummary_

Returns

The added element end tag.

Syntax

JavaScript
End(name, textState, addIndent = true)

Appends the element end tag.

Remarks

End() is an "Append Element" method. It creates the element text with GetEnd() and adds it to the builder. The appended text does not end with a new line. This allows for additions after the text. The added text will start with a new line if the builder text already has a value.

Example

JavaScript
// Appends the element end tag.
End()
{
  // Root Method Begin
  let textState = new LJCTextState();

  const tb = new LJCTextBuilder(textState);
  const attribs = tb.Attribs("className");
  tb.Begin("div", textState, attribs);

  // Example Method:
  tb.End("div", textState);

  const result = tb.ToString();

  // result:
  // "<div class=\"className\">"
  // "</div>"
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.