$(document).ready(function(){ var cnt=2; var table = document.createElement("table"); table.setAttribute('id',"table2"); table.setAttribute('width','100%'); var tr = document.createElement('tr'); var td3=document.createElement('td'); td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); td3.appendChild( input = document.createElement("input"), input.setAttribute("type","time"), input.setAttribute("id","Time"), input.setAttribute("max","24"), input.setAttribute("min","1"), input.setAttribute("required") ) var td=document.createElement('td'); td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td.appendChild( sourcecbo= document.createElement('select'), sourcecbo.setAttribute('id','source'), sourcecbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Mrk 501")) ), sourcecbo.setAttribute('id','source') ); var td1=document.createElement('td'); td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td1.appendChild( measurementcbo= document.createElement('select'), measurementcbo.setAttribute('id','measurement'), measurementcbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Calibration")) ), measurementcbo.setAttribute('id','measurement') ); var td2=document.createElement('td'); td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td2.appendChild( input = document.createElement('input'), input.setAttribute('type','text'), input.setAttribute('id','txtData') ); var td4=document.createElement('td'); td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td4.appendChild( button = document.createElement('input'), button.setAttribute("type",'button'), button.setAttribute('id','btnSplit'), button.setAttribute('value','Split'), button.onclick= function() { split1(); } ); td4.appendChild( button=document.createElement('input'), button.setAttribute('type','button'), button.setAttribute('value','Delete'), button.setAttribute('id','btnDelete'), button.onclick=function(){ $('#table2').remove(); } ); tr.appendChild(td3); tr.appendChild(td); tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td4); table.appendChild(tr); $('#TableH1').append(table); var table = document.createElement("table"); table.setAttribute('id',"table1"); table.setAttribute('width','100%'); var tr = document.createElement('tr'); tr.setAttribute('id',''); tr.setAttribute('class',''); var td3=document.createElement('td'); td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); td3.appendChild( input = document.createElement("input"), input.setAttribute("type","time"), input.setAttribute("id","Time"), input.setAttribute("max","24"), input.setAttribute("min","1"), input.setAttribute("required") ) var td=document.createElement('td'); td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td.appendChild( sourcecbo= document.createElement('select'), sourcecbo.setAttribute('id','source'), sourcecbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Mrk 501")) ), sourcecbo.setAttribute('id','source') ); var td1=document.createElement('td'); td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td1.appendChild( measurementcbo= document.createElement('select'), measurementcbo.setAttribute('id','measurement'), measurementcbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Calibration")) ), measurementcbo.setAttribute('id','measurement') ); var td2=document.createElement('td'); td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td2.appendChild( input = document.createElement('input'), input.setAttribute('type','text'), input.setAttribute('id','txtData') ); var td4=document.createElement('td'); td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td4.appendChild( button = document.createElement('input'), button.setAttribute("type",'button'), button.setAttribute('id','btnSplit'), button.setAttribute('value','Split'), button.onclick= function() { split(); } ); td4.appendChild( button=document.createElement('input'), button.setAttribute('type','button'), button.setAttribute('value','Delete'), button.setAttribute('id','btnDelete'), button.onclick=function(){ $('#table1').remove(); } ); tr.appendChild(td3); tr.appendChild(td); tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td4); table.appendChild(tr); $('#TableH').append(table); function split() { cnt++; var table = document.createElement("table"); table.setAttribute('id',"table"+cnt); table.setAttribute('width','100%'); var tr = document.createElement('tr'); tr.setAttribute('id',''); tr.setAttribute('class',''); var td3=document.createElement('td'); td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); td3.appendChild( input = document.createElement("input"), input.setAttribute("type","time"), input.setAttribute("id","Time"), input.setAttribute("max","24"), input.setAttribute("min","1"), input.setAttribute("required") ) var td=document.createElement('td'); td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td.appendChild( sourcecbo= document.createElement('select'), sourcecbo.setAttribute('id','source'), sourcecbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Mrk 501")) ), sourcecbo.setAttribute('id','source') ); var td1=document.createElement('td'); td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td1.appendChild( measurementcbo= document.createElement('select'), measurementcbo.setAttribute('id','measurement'), measurementcbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Calibration")) ), measurementcbo.setAttribute('id','measurement') ); var td2=document.createElement('td'); td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td2.appendChild( input = document.createElement('input'), input.setAttribute('type','text'), input.setAttribute('id','txtData') ); var td4=document.createElement('td'); td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td4.appendChild( button = document.createElement('input'), button.setAttribute("type",'button'), button.setAttribute('id','btnSplit'), button.setAttribute('value','Split'), button.onclick=function(){ split(); } ); td4.appendChild( button=document.createElement('input'), button.setAttribute('type','button'), button.setAttribute('value','Delete'), button.setAttribute('id','btnDelete'), button.onclick=function(){ $('#table'+cnt).remove(); cnt--; } ); tr.appendChild(td3); tr.appendChild(td); tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td4); table.appendChild(tr); $('#TableH').append(table); } function split1() { cnt++; var table = document.createElement("table"); table.setAttribute('id',"table"+cnt); table.setAttribute('width','100%'); var tr = document.createElement('tr'); tr.setAttribute('id',''); tr.setAttribute('class',''); var td3=document.createElement('td'); td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); td3.appendChild( input = document.createElement("input"), input.setAttribute("type","time"), input.setAttribute("id","Time"), input.setAttribute("max","24"), input.setAttribute("min","1"), input.setAttribute("required") ) var td=document.createElement('td'); td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td.appendChild( sourcecbo= document.createElement('select'), sourcecbo.setAttribute('id','source'), sourcecbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Mrk 501")) ), sourcecbo.setAttribute('id','source') ); var td1=document.createElement('td'); td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); td1.appendChild( measurementcbo= document.createElement('select'), measurementcbo.setAttribute('id','measurement'), measurementcbo.appendChild( option=document.createElement('option'), option.setAttribute('value','1'), option.setAttribute('selected',true), option.appendChild(document.createTextNode("Calibration")) ), measurementcbo.setAttribute('id','measurement') ); var td2=document.createElement('td'); td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td2.appendChild( input = document.createElement('input'), input.setAttribute('type','text'), input.setAttribute('id','txtData') ); var td4=document.createElement('td'); td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); td4.appendChild( button = document.createElement('input'), button.setAttribute("type",'button'), button.setAttribute('id','btnSplit'), button.setAttribute('value','Split'), button.onclick=function(){ split(); } ); td4.appendChild( button=document.createElement('input'), button.setAttribute('type','button'), button.setAttribute('value','Delete'), button.setAttribute('id','btnDelete'), button.onclick=function(){ $('#table'+cnt).remove(); cnt--; }); tr.appendChild(td3); tr.appendChild(td); tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td4); table.appendChild(tr); $('#TableH1').append(table); } });