Imagem de fundo

Considere uma página Web que exibe somente um botão. Quando...

Considere uma página Web que exibe somente um botão. Quando essa página é carregada, ou o botão é clicado, a data corrente é exibida.


O trecho de um script que implementa corretamente essa lógica é:


A

<html>

<body>

<button onclick, onload="XPTO()">Clique

aqui...</button>

<script>

function XPTO() {alert();}

</script>

</body>

</html>


B

<html>

<body>

<button onclick="XPTO()">Clique

aqui...</button>

<script>

function XPTO() {alert(Date());}

</script>

</body>

</html>


C

<html>

<body>

<button onload, onclick="XPTO()">Clique

aqui...</button>

<script>

function onload XPTO() {alert();}

</script>

</body>

</html>


D

<html>

<body onload="XPTO()">

<button onclick="XPTO()">Clique

aqui...</button>

<script>

function XPTO() {alert(Date());}

</script>

</body>

</html>


E

<html>

<body onload="XPTO()"

<button onclick="XPTO()">Clique

aqui...</button>

>

<script>

function onload XPTO(Date()) {}

</script>

</body>

</html>