I have the following JavaScript, it finds a list items with a given value and changes their font color. It works when I run it in from the IE Developer Tools - Script debugger. Here is a code sample.
<SCRIPT type=text/javascript> var colorCode = document.getElementsByTagName("td"); var i = 0; for (i = 0; i < colorCode.length; i++) { if (colorCode[i].className == "ms-cellstyle ms-vb2") { if (colorCode[i].innerHTML == "Green") { colorCode[i].style.color = 'Green'; } if (colorCode[i].innerHTML == "Yellow") { colorCode[i].style.color = 'Yellow'; } if (colorCode[i].innerHTML == "Red") { colorCode[i].style.color='Red'; } } }</SCRIPT>
When I insert a Script Editor webpart and add the exact same code snippet nothing happens.
Any Ideas?