I am trying to change the color of a number in a text file when the number gets below a certain point. this file is read in with javascript. For example, if the number is 400, the text color should turn green. If the number is 200, the text color should turn red
I have tried to use the fontcolor() function and have not had any luck. The code that I have provided just basically shows the content of the text file inside the iframe. I want to be able to change the color of the text inside of the iframe
<iframe id="textfile" src="john.txt"></iframe>
<script type="text/javascript">
function print() {
var iframe = document.getElementById('textfile');
iframe.contentWindow.print();
}
</script>
For example, if the number is 400, the text color should turn green. If the number is 200, the text color should turn red