I THINK ∴ I'M DANGEROUS

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
stocks:proof-report-2016-05-03 [2016/05/03 16:02]
zashi
stocks:proof-report-2016-05-03 [2016/05/03 16:17]
zashi
Line 27: Line 27:
  
 <​html>​ <​html>​
-<​script ​type="​javascript"​+<​script>​ 
-function condFormat(item,​ index) { +
-  item.innerHTML = '​green';​ +
-}+
 cells = document.getElementsByClassName("​col4"​);​ cells = document.getElementsByClassName("​col4"​);​
-cells.forEach(condFormat);+for (var i = 0, len = cells.length; i < len; i++) 
 +
 +  val = cells[i].innerHTML.replace(/​[^0-9\.]/​g,''​); 
 +  if (val < 1) { 
 +    cells[i].style.background = '#​FF5F5F';​ 
 +  } 
 +  if (val >= 1 && val < 2) { 
 +        cells[i].style.background = '#​F9FF5F';​ 
 +  } 
 +  if (val >= 2) { 
 +        cells[i].style.background = '#​32DD37';​ 
 +  } 
 +
 </​script>​ </​script>​
 </​html>​ </​html>​