Change text color dynmically
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";
0