And <button id="test">Test</button> would be replaced by the submit button.

In the first place, after editing the code and changing <div id="output"></div> for <input id="output"/> the fourth field does not receive any content from the 3 fields above, so I have no tested it in a form.