<pre><!DOCTYPE html> <html> <head> <style> </style> </head> <body> <body> <input type="text" id="text1" size="50"> <input type="text" id="text2" size="50"> </body> <script type="text/javascript"> document.getElementById("text1").addEventListener("keyup", testpassword2); document.getElementById("text2").addEventListener("keyup", testpassword2); function testpassword2() { var text1 = document.getElementById("text1"); var text2 = document.getElementById("text2"); if (text1.value <= text2.value) text2.style.backgroundColor = "#2EFE2E"; else text2.style.backgroundColor = "red"; } </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)