jQuery simple print textbox


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="jquery.js"></script>
  4. <script type="text/javascript">
  5. $(document).ready(function() {
  6. $("#submitButton").click(function() {
  7. if($("#textin").val() == "") {
  8. $("#resdiv").append("(No Text)<br />")
  9. } else {
  10. $("#resdiv").append($("#textin").val() + "<br />");
  11. }
  12. });
  13. });
  14. </script>
  15. </head>
  16. <body>
  17. Text In :<br />
  18. <textarea id="textin"></textarea><br />
  19. <input type="button" id="submitButton" value="Send Text" /><br />
  20. <hr />
  21. <div id="resdiv"></div>
  22. <hr />
  23. </body>
  24. </html>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.