JSFiddle - React, Tailwind, and code Playground

by Rapha Souza

HTML

<script src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!DOCTYPE html>
<html>
<body>

<p>Click the button to add new elements to the array.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>
<input type="text" id="nome1" value="nome1">
<input type="text" id="cpf1" value="0001">

<input type="text" id="nome2" value="nome2">
<input type="text" id="cpf2" value="0002">

<input type="text" id="resultado">

<script>


var fruits = []
document.getElementById("demo").innerHTML = fruits;

function myFunction() {


for (var i = 1; i< 10; i++){

  fruits.push(document.getElementById("nome" + i).value);
	document.getElementById("demo").innerHTML = fruits;
document.getElementById("resultado").value = fruits;
}


}
</script>

</body>
</html>

CSS

.row {
  background: #f8f9fa;
  margin-top: 20px;
}

.col {
  border: solid 1px #6c757d;
  padding: 10px;
}