I'm starting with javascript and I made the following code, only it is not working in google chrome, why?
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Teste</title>
</head>
<body>
<form>
<input type="text" name="teste" id="teste"/>
</form>
</body>
<script type="text/javascript" src="test.js"></script>
</html>
test.js
var teste = document.getElementById("teste");
teste.addEventListener('click', function(){
alert(1);
});
I have already tested it on Firefox and the JS Bin site and it works perfectly.