DWEC

Logo

Desenvolupament web en entorn client (DAW)

View the Project on GitHub jrodr236/DWEC

Events

Teoria completa

Els events d’HTML son “coses” que passen als elements HTML.

JavaScript pot “reaccionar” a aquests events.

Exemples d’events:

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the date.</p>

<button onclick="displayDate()">The time is?</button>

<script>
function displayDate() {
    document.getElementById("demo").innerHTML = Date();
}
</script>

<p id="demo"></p>

</body>
</html>

demo

Alguns events habituals: