D
dusan j
Guest
i have this code but it does not work, and i do not know why, whatever i enter it goes to google please help :
<html>
<head>
<title>Retrieving Text</title>
<script language="javascript" type="text/javascript">
function alertText()
{
var text = document.simpleForm.myText.value;
if (text = "google")
{
window.open("http://www.google.com");
}
else if ( text = "major")
{
window.open("http://www.msn.com");
}
else
{
alert("nisi ukucao google");
}
}
</script>
</head>
<body>
<form name="simpleForm">
<input type="text" name="myText" size="20" />
<input type="button" value="Alert Text" onclick="alertText()" />
</form>
</body>
</html>
<html>
<head>
<title>Retrieving Text</title>
<script language="javascript" type="text/javascript">
function alertText()
{
var text = document.simpleForm.myText.value;
if (text = "google")
{
window.open("http://www.google.com");
}
else if ( text = "major")
{
window.open("http://www.msn.com");
}
else
{
alert("nisi ukucao google");
}
}
</script>
</head>
<body>
<form name="simpleForm">
<input type="text" name="myText" size="20" />
<input type="button" value="Alert Text" onclick="alertText()" />
</form>
</body>
</html>