Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

On click form submit data show in a table jQuery

You can also toggle between hiding and showing an element by using toggle() method.

Shown elements are hidden and hidden elements are shown:

The optional speed parameter can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is a function to be executed after toggle() completes.




<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
<script src=""></script>

<div class="w3-col s4 ">
<div class="w3-container w3-blue w3-card">
  <h2>Input Form</h2>
<form class="w3-container w3-card">
  <label>First Name</label>
  <input class="w3-input" type="text" id="first_name"></p>
  <label>Last Name</label>
  <input class="w3-input" type="text" id="last_name"></p>
  <input class="w3-input" type="text" id="email"></p>
  <P><button type="button" class="w3-btn w3-blue" id="save">Save</button>
<table class="w3-table-all" id="myTable">
<tr class="w3-blue">
<th nowrap>Sl.No</th>      
<th nowrap>First Name</th>      
<th nowrap>Last name</th>
<th nowrap>Email</th>
<th nowrap>Action</th>
<tbody >
<script type="text/javascript">
$('#save').on('click', function() {
var first_name=$('#first_name').val();
var last_name=$('#last_name').val();
var email=$('#email').val();
var count = $('#myTable tr').length;
if(first_name!="" && last_name !="" && email!=""){
$('#myTable tbody').append('<tr class="child"><td>'+count+'</td><td>'+first_name+'</td><td>'+last_name+'</td><td>'+email+'</td><td><a href="javascript:void(0);" class="remCF1 btn btn-small btn-danger">Remove</a></td></tr>');
$('#myTable tbody tr').each(function(i){            

Run it Yourself »