<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js">
</script>
<script>
$(document).ready(function()
{
$("button").click(function()
{
var x =
$("form").serializeArray();
$.each(x, function(i,
field) {
$("#output").append(field.name
+ ":"+ field.value + " ");
});
});
});
</script>
</head>
<body>
<div
id="GFG">
<form
action="#">
Name: <input
type="text" name="Name">
<br>
</form>
<button>Submit</button>
</div>
<div
id="output"></div>
</body>
</html>