/ LJCJSCodeDoc / LJCCommonLib / LJC / HasElementValue


Parameters
element - An HTMLElement object.

Returns

true if the element has content; otherwise false.

Syntax

JavaScript
static HasElementValue(element)

Checks if an element has a value.

Example

JavaScript
// Checks if an element has a value.
HasElementValue()
{
  const element = targetInput;
  LJC.SetValue("targetInput", "X");
  let result = LJC.HasElementValue(element);
        
  // result:
  // true

  LJC.SetValue("targetInput", "  ");
  result = LJC.HasElementValue(element);
        
  // result:
  // false
}

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