I am currently working with a JavaScript file where I have a variable defined as follows:
var nombre = document.getElementById('nombre').value;
The 'nombre' variable corresponds to an element in an HTML file:
Nombre: <input type="text" name="name_control" id="nombre" autofocus required />
After adding this variable to a list, I would like to customize the text by changing its color or size when it is inserted into the list. Is this achievable? Any suggestions would be appreciated.
Edit: I have attempted the following approach. However, when adding 'nombre' to the list, it appears as simple, dark, and small text. I actually want 'nombre' to be added in red color and larger font size.
var node = document.createElement("LI");
var textnode = document.createTextNode(nombre+" ");
node.appendChild(textnode);