I am new to Javascript and am having some difficulty. I want to have the user type in a word and have a function identify the word and print it back to the user on the same page. Everytime I run this code though it takes me to a DIFFERENT page AND prints '[object]'. Here is my code. Can someone please help me.
Live Long and Prosper.
<html>
<head>
<script src="raphael-min.js"></script>
<script src="jquery-1.7.2.js"></script>
<script type="text/javascript">
function animate() {
var txt = document.getElementById("words");
document.write(txt);
}
</script>
</head>
<body>
Text: <input type="text" id="words" value="" />
<input type="submit" value="Animate" onclick="animate()" />
</body>
</html>