Get started with jquery.serializeJSON CDN
MIT licensed
JQuery.serializeJSON converts a jQuery serialized form or an object into a JSON format.
Tags:- jquery
- serialize
- form
- helper
Stable version
Copied!
How to start using jquery.serializeJSON CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with jquery.serializeJSON CDN - cdnhub.io</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.cdnhub.io/jquery.serializeJSON/3.2.1/jquery.serializejson.min.js"></script>
</head>
<body>
<form id="myForm">
<input type="text" name="name" value="John Doe">
<input type="email" name="email" value="[email protected]">
<input type="number" name="age" value="30">
</form>
<button type="button" id="serializeBtn">Serialize Form</button>
<script>
$(document).ready(function() {
$('#serializeBtn').click(function() {
$form = $('#myForm');
data = $form.serializeObject();
console.log(JSON.stringify(data));
});
});
</script>
</body>
</html>
Copied!
Copied!