I'm trying to set up an html web page that depends on the user entering a certain word in one text box to make another text box display a different word. Ultimately the use of this feature will become more complex but for now I just want to make that simple routine work. I've written code but it doesn't seem to follow the logic. When I click on the button no matter what is in text1 both text1 and text2 show "Dog" and "Cat" respectively. Here's my code that isn't working:
enter code here
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
function myFunction() {
if (Text1.value = "Dog")
{
Text2.value = "Cat";
}
else
{
Text2.value = "Mouse";
}
}
</script>
<br><br><br><br>
<font size=6 face=arial color=#336699>
<b>TestRoutine</b>
<br><br>
</font>
<input id="Button1" type="button" value="button" onclick="myFunction()">
<input id="Text1" type="text" />
<input id="Text2" type="text" />
</body>
</html>