Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Exercice 5</title>
- <script>
- function Min(x,y) {
- if(x > y) return y;
- else return x;
- }
- function verify(s1,s2) {
- for(i = 0 ; i < Min(s1.length,s2.length) ; i++) {
- if(s1[i] != s2[i])
- return false;
- }
- return true;
- }
- function check() {
- s1 = F.T1.value;
- s2 = F.T2.value;
- if(verify(s1,s2))
- alert("Vrai");
- else
- alert("Faux");
- }
- </script>
- </head>
- <body>
- <form name="F">
- Chaine1 : <input type="text" name="T1"><br>
- Chaine2 : <input type="text" name="T2"><br>
- <input type="button" value="Verifier" onclick="check()">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement