JSFiddle - React, Tailwind, and code Playground

by cheakeanauva

HTML

<html>
    <head>

</head>
<body>
	
	<div id="Data">
	</div>
</body>
</html>

JavaScript

function clearNode(node){
		var child = node.childNodes[0];
		while(child != null)
		{
			node.removeChild(child);
			child = node.childNodes[0];
		}	
	}
	
	
	function addRow(table){
		$("#Data tr:first").before(nextrow);
		 
		 
		var targetView = table;
		// CREATE ELEMENT	
		var newtr = document.createElement("tr");
		
		var newtd_c1 = document.createElement("td");
			newtd_c1.setAttribute("width","147");
			newtd_c1.setAttribute("align","center");
			newtd_c1.appendChild(
				input_data = document.createElement("input"),
				input_data.setAttribute("type","time"),
				input_data.setAttribute("size","10"),
				input_data.setAttribute("autofocus","true")
			);
		var newtd_c2 = document.createElement("td");
			newtd_c2.setAttribute("width","138");
			newtd_c2.setAttribute("align","center");
			newtd_c2.appendChild(
				selection = document.createElement("select"),
				<?php   
				$selectm = mysql_query("SELECT * FROM measurement");
				while($rowmeasure = mysql_fetch_array($selectm)){
			
			?>
			selection.appendChild(option = document.createElement("option"),option.setAttribute("value","<?php echo $rowmeasure['fMeasurementKey']; ?>"),option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))),
				<?php  } ?>
				selection.setAttribute('id','source')
			);
			
			//var newtd_c2 = document.createElement("td");
			newtd_c2.setAttribute("width","115");
			newtd_c2.setAttribute("align","center");
			newtd_c2.appendChild(
				input_data = document.createElement("input"),
				input_data.setAttribute("type","button"),
				input_data.setAttribute("value","+"),
				input_data.onclick = function(){ return addRow(table); }
			);
		
		var newtd_c3 = document.createElement("td");
			newtd_c3.setAttribute("width","98");
			newtd_c3.setAttribute("align","center");
			newtd_c3.appendChild(
				selection = document.createElement("select"),
					<?php
				
					$select = mysql_query("SELECT * FROM source");
					
				while($rowsource =...