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
Post a Comment