Ciao, ho appena cominciato a usare javascript.
I miei due file sono prova.html:
e prova.js (voglio necessariamente avere il file .js separato dall'html):<html>
<head>
<title>Prova</title>
<script src="prova.js"></script>
</head>
<body>
<button id="bottone" type="button" name="primo">Enter</button>
</body>
</html>
ma quando clicco sul bottone non succede niente, quale è il problema?var target = document.getElementById("bottone"); if (target.onclick) alert("ciao");

Rispondi quotando