- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the content of a textarea using jQuery?
Here I am using one textarea and one button.The first textarea is used for user input then click the button and display the value in the alert box.
Example
<html> <head> <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("button").click(function () { var dim = $("#txt").val(); alert(dim); }); }); </script> </head> <body> <div> <textarea id="txt" rows="5" cols="20"></textarea> <button type="button" id="btn">Click Here</button> </div> </body> </html>
Advertisements