I am dynamically modifying a textfield using Javascript by adding some extra character (say X). For this I use:
document.forms['Form1'].elements['some_field'].value = document.forms['Form1'].elements['some_field'].value + "X";
But can I change the color of “X”? Like have it insert (say) a Red colored “X”.
You can use a
contenteditablespan and make it look like a text box.HTML:
JavaScript:
(optional) CSS Styling
Demo: http://jsfiddle.net/TnUQW/