Oi gostaria de saber se TEM Como Apos o leque ter percorridodo Primeiro PARA O ultimo, apagar fazer ultimo parágrafo O Primeiro, Sendo that o input Será, apagado da posição anterior?
<! doctype html>
<html>
<head>
<meta charset = "utf-8">
<title> Untitled Document </ title>
</ Head>
<body>
<script>
var telefone = new Array ();
telefone [0] = "Telefone 1:";
telefone [1] = "Telefone 2:";
telefone [2] = "Telefone 3:";
var cont = 0;
var myFunction = function () {
if (cont <telefone.length) {
var n = document.getElementById ("minhaArea");
var oF = document.createElement ("div");
var oFI = document.createElement ("div");
oF.setAttribute ("id", "f" + cont);
oFi.setAttribute ("id", "g" + cont);
n.appendChild (oF);
n.appendChild (oFI);
document.getElementById ("f" + cont) .innerHTML = "<input type =" Numero "id =" minha "+ cont +" "> <input type =" Botão "onClick = 'apaga (" cont + "+) "valor = '-'>";
document.getElementById ("g" + cont) .innerHTML = telefone [cont];
cont ++;
}
};
apaga Function (id) {
var n = document.getElementById ("minhaArea");
var oF = document.getElementById ("f" + id);
var oFI = document.getElementById ("g" + id);
var apagado = n.removeChild (oF);
apagados var = n.removeChild (oFI);
cont--;
};
</ Script>
<input type = "Button" = "Telefones:" onclick = "myFunction ()">
<div id = "minhaArea"> </ div>
</ Body>
</ Html>