/ LJCJSCodeDoc / LJCCommonLib / LJC / TagElements


Parameters
parentElement - The parent HTMLElement.
tagName - An HTML tag name.

Returns

An array of HTML elements.

Syntax

JavaScript
static TagElements(parentElement, tagName)

Gets HTMLElements by Tag.

Example

JavaScript
// Gets HTMLElements by Tag.
TagElements()
{
  const parentElement = document.body;
  const tagName = "div";

  const elements = LJC.TagElements(parentElement, tagName);
  const element = elements[0];
  const result = element.id;

  // result:
  // testDiv
}

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