Salve a tutti
coma faccio a comparare due stringhe? ho scritto questo codice che non mi gira e non capisco il motivo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function isSameString( s1, s2 )
{
if (s1 == s2)
{
alert("bene");
return true;
}
else
alert("sbagliato");
{
return false;
}
}
</script>
</head>
<body>
<input tabindex="3" name="s1" type="text" size="30" />
<input tabindex="3" name="s2" type="text" size="30" />
<input id="button" type="button" value="+" onclick= (isSameString(s1,s2)) />
</body>
</html>
grazie in anticipo![]()

Rispondi quotando
