Untitled
unknown
html
a year ago
693 B
12
Indexable
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inverter Nome</title>
</head>
<body>
<h2>Inverter nome</h2>
<input type="text" id="inputNome" placeholder="Insira o nome">
<button onclick="inverterNome()">Inverter</button>
<p id="resultado"></p>
<script>
function inverterNome() {
let resultado = document.getElementById('resultado')
let nome = document.getElementById('inputNome').value
let nomeInvertido = nome.split('').reverse().join('')
resultado.innerText = nomeInvertido.toLowerCase()
}
</script>
</body>
</html>Editor is loading...
Leave a Comment