-2
By typing the text in input
and click on the button, the function alert()
does not perform!
My code:
<html lang="pt">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Teste Javascript</h1>
<div id="app">
<input type="text" name="nome" />
<input type="text" name="nome2" />
<button class="botao">Pressione aqui</button>
</div>
<script>
var inputElement = document.querySelector('input[name=nome2]');
var btnElement = document.querySelector('button.botao');
btnElement.onClick = function(){
var text = inputElement.value;
alert(text);
}
</script>
</body>
</html>
What’s the matter?
First of all [Dit] your question and post your code as text instead of image...
– LipESprY
Ready! Sorry for the delay, I was working out. Thanks for the help !! thanks!
– Math2Syess