This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* adicionar novo item | |
function newPhone() { | |
//* 1. seleciona o elemento que irá receber os novos filhos | |
const phoneGroup = document.querySelector("form#phones"); | |
//* 2. cria os filhos | |
const newPhoneField = document.createElement("p"); | |
const newPhoneLabel = document.createElement("label"); | |
const newPhoneInput = document.createElement("input"); | |
newPhoneInput.setAttribute("name", "phone"); |