JSFiddle - React, Tailwind, and code Playground

by dvanauken

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
<form id="frmPeople" method="post">
  <table border="1">
    <tr>
      <th>NID</th>
      <th>Last Name</th>
      <th>First Name</th>
    </tr>
    <tr>
      <td>
        <input type="text" name="nid" value="111-111-1111">
      </td>
      <td>
        <input type="text" name="lastName" value="Smith">
      </td>
      <td>
        <input type="text" name="firstName" value="John">
      </td>
    </tr>
    <tr>
      <td>
        <input type="text" name="nid" value="222-222-2222">
      </td>
      <td>
        <input type="text" name="lastName" value="Anderson">
      </td>
      <td>
        <input type="text" name="firstName" value="Gary">
      </td>
    </tr>
    <tr>
      <td>
        <input type="text" name="nid" value="333-333-3333">
      </td>
      <td>
      <input type="text" name="lastName" value="Carson">
      </td>
      <td>
      <input type="text" name="firstName" value="Bill">
      </td>
    </tr>
  </table>
</form>
<input type="button" id="button2" value="Test" />


<div id='out' style="background:white;width=100px;height=20px;">

</div>

JavaScript

$('#button2').click(function() {
   $('#out').html("<p>test</p>");
   var data = JSON.stringify($('#frmPeople').serializeArray());
   alert('data=['+ data + ']');
});