/ LJCJSCodeDoc / LJCCommonLib / LJC / SetValue


Parameters
elementID - The element ID name.
text - A string value.

Syntax

JavaScript
static SetValue(elementID, text)

Sets the input element value.

Example

JavaScript
<body>
  <input type="text" id="targetInput">
</body>

// Sets the input element value.
SetValue()
{
  const elementID = "targetInput";
  LJC.SetValue(elementID, "X");
  let result = LJC.GetValue(elementID);
        
  // result:
  // "X";

  LJC.SetValue(elementID, "");
  result = LJC.GetValue(elementID);
        
  // result:
  // "";
}

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