JSFiddle - React, Tailwind, and code Playground

by thewolff

HTML

<html>

  <head>
  </head>

  <body>
    <table>
      <thead>
        <th>Name</th>
        <th>Address</th>
        <th>Phone</th>
        <th>Action</th>
      </thead>
      <tbody>
				<tr>
        </tr>
      </tbody>
    </table>
  </body>


<form id="addForm">
Name: <input type="text" name="pName"><br/>
Address: <input type="text" name="pAddress"><br/>
Phone: <input type="text" name="pPhone"><br/>
<button id="addPerson" type="button" onClick="addPerson(this)" >Add Person</button>
</form>
</html>

JavaScript

const people = [];
people.push({
name: 'AB',
address: 'Toronto',
phone: '647777'
},
{
name: 'CD',
address: 'Calgary',
phone: '23472'
},
{
name: 'VS',
address: 'Vancouver',
phone: '88993'
});

addPerson(form) {
console.log(form, 'form');
}