javascript - Retrieve text from textarea -


i have <textarea></textarea> on html page , want retrieve info based on user types it. if user types "hello" in textarea. "how you" appear.

like (code doesn't work, example:

<script>         if ('msg'.value === "hello") {         document.write("how you");     } </script> <textarea  id="msg"></textarea> <input type="submit></input> 

hope can me out!

edit: outputs msg val, on submit.

thanks!

'msg' string. need element:

if (document.getelementbyid('msg').value === "hello") {     document.write("how you"); } 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -