Skip to content

Instantly share code, notes, and snippets.

@murilomothsin
Created February 20, 2016 05:32
Show Gist options
  • Save murilomothsin/cd61be5488f07e8cb40d to your computer and use it in GitHub Desktop.
Save murilomothsin/cd61be5488f07e8cb40d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script type="text/javascript">
window.onload = function () {
document.getElementById("hello").addEventListener("click", function () {
alert("Olá " + document.getElementById("nome").value);
});
};
</script>
</head>
<body>
<noscript>
<div style="color: red;">Seu navegador não suporta JavaScript ou ele está desabilitado. </div>
</noscript>
<label>Nome: <input type="text" id="nome"></label>
<button id="hello">Dizer "Olá"</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment