DOM:event.detail
z Mozilla Developer Center, polskiego centrum programistów Mozilli.
Spis treści |
[edytuj] Podsumowanie
Zwraca szczegółową informację o zdarzeniu zależnie od jego typu.
[edytuj] Składnia
number = event.detail
[edytuj] Przykład
<html>
<head>
<title>event.detail</title>
<script>
function giveDetails(e) {
// details = e.detail;
text = document.getElementById("t");
text.setAttribute("value", e.detail);
}
function init() {
b1 = document.getElementById("b");
b1.onclick=giveDetails;
}
</script>
</head>
<body onload="init();">
<form>
<input id="b" type="button" value="details" />
<input id="t" type="text" value="" /><br/>
<input type="reset" />
</form>
</body>
</html>
[edytuj] Uwagi
detail jest liczbą oznaczającą ile razy klknięto myszą w tym samym miejscu w tym zdarzenia. Wartość detail to zwykle 1.