XML DOM type event attribute
Definition and Usage
The type event attribute returns the type of the event that occurred, that is, the name of the event represented by the current Event object.
It has the same name as the event handler, or is the prefix 'on' removed from the event handler attribute, such as 'submit', 'load', or 'click'.
Syntax
event.type
Example
The following example can return the type of the event triggered:
<html>
<head>
<script type="text/javascript">
function getEventType(event)
{
alert(event.type
);
}
</script>
</head>
<body onmousedown="getEventType(event)">
<p>Click somewhere in the document.
An alert box will tell what event
type you triggered.</p>
</body>
</html>
TIY
- type event
- ການກັບຄືນຄຸນນະພາບຂອງພາກສ່ວນທີ່ຖືກກະຕຸ້ນ (IE Browser ບໍ່ສາມາດສະໜັບສະໜູນໄດ້).