-1
//Variaveis Globais
var d = document;
var Nomes = [];
function processar(idTabela) //Inserir Linhas e Verificar se ja foi escrito o nome
{
var newRow = d.createElement('tr');
newRow.insertCell(0).innerHTML = d.getElementsByName('Nome')[0].value;
newRow.insertCell(1).innerHTML = d.getElementsByName('Idade')[0].value;
d.getElementById(idTabela).appendChild(newRow);
Nomes.push = d.getElementsByName('Nome')[0].value;
return false;
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>DOCUMENTO</title>
</head>
<body>
<!--Formulario-->
<form name="formulario" onsubmit="return processar('myTable')">
Nome: <input type="text" name="Nome"> Idade: <input type="number" name="Idade">
<input type="submit" value="Salvar">
</form>
<!--Tabela-->
<table width='250' height='250'>
<tbody id="myTable"></tbody>
</table>
<!--Adicionando Arquivos-->
<script src="codigo.js"></script>
</body>
</html>
Gabriel, what do you mean several . value? Your Names.push line is wrong, push is an array method, the value needs to be sent in parentheses and not using assignment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push
– Daniel Mendes