Edit in JSFiddle

// listener
$(":input").on("keyup change", WriteFormDataToDiv);

// call on load

function WriteFormDataToDiv() {
  var data = $(":input").serializeArray()
  var html = JSON.stringify(data, null, 2)
<input type="text" name="cat"     value="frida" />
<input type="text" name="dog"     value="buddy" /><br/>
<input type="text" name="food"    value="pizza" />
<input type="text" name="dessert" value="ice cream" />

<pre id="formdata"></pre>

<div style='position:fixed;bottom:0;left:0; background:lightgray;width:100%;'>
  About these SO Questions
    <li><a href="https://stackoverflow.com/q/4810841/1366033">
      How can I pretty-print JSON using JavaScript?
    <li><a href="https://stackoverflow.com/q/2614862/1366033">
      How can I beautify JSON programmatically?
    <li><a href="https://stackoverflow.com/q/3515523/1366033">
     Javascript: How to generate formatted easy-to-read JSON straight from an object?
    <li><a href="https://stackoverflow.com/q/1380462/1366033">
      How do I write json results to a div using jquery?
pre {
  padding: 15px;
  background: lightgrey;