Hello all, I'm totally new to this forum, My name is Chris from the Netherlands. I'm trying to lern javascript, but my knowledge doesn't cover what I want, so I could really use some help. I'm trying to make a lotto check form for our family.
Can somebody explain me how to alter this code to color the font green even if the match isn't on the same place, please take a look at this image, it explains more then 1000 words.
Here is an example, don't mind the banner, it's a family joke, so nothing commercial.it only works in IE at the moment.
http://www.coldcharlie.nl/lotto.html
Beneath is a graphical explaination, I really hopes this helps.Code:<SCRIPT TYPE="TEXT/JAVASCRIPT"> // Check lotto function checkLotto() { var goed = frmTrekking.Getal var fout = frmGetallen.Opgegeven for (var z0=0;z0<goed.length;z0++){ if (goed[z0]&&fout[z0]){ if (goed[z0].value==fout[z0].value){ fout[z0].parentNode.style.color='#00FF00'; fout[z0].parentNode.getElementsByTagName('SPAN')[0].innerHTML+=goed[z0].value; } else { fout[z0].parentNode.style.color='#cc0000'; fout[z0].parentNode.getElementsByTagName('SPAN')[0].innerHTML+=fout[z0].value; } } } } </script>
![]()



it only works in IE at the moment.
Reply With Quote
Bookmarks