- 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 a key/value data set from a HTML form?
To get a key/ value data set from a HTML form, use jQuery.
Let us say this is our HTML −
<form id = "form1"> <input type = "text" name = "demo" /> </form>
For JS −
var data = $('form#form1’).serializeArray(); // [{'demo: 'value'}] $.ajax({ data: data });
Advertisements