You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Change text color dynmically

edited Jun 30, 2020 3:24PM in Visual Builder 5 comments

Content

We are looking to change the text color of our oj-input-text based on certain conditions.

We have tried several options:

  • Call a JS function passing the element id of the oj-input-text and changing the style color to red using the following code.  It does not work.  We have to add "myElement.textContent = "My New Value";" after changing the style to see the text changed to red.  However, doing this removes all other styling from the text box.  We lose the border, the background color and the size of the text box.
var myElement = document.getElementById("my-text-box");
myElement.style.color="red";

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!