JavaScript Reference/Javascript Properties/cancelBubble — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 26 мая 2010
Содержание
"cancelBubble" Example
<html>
<head>
<script language="JavaScript">
function function1() {
if (window.event.shiftKey){
window.event.cancelBubble = true;
}
alert(window.event.cancelBubble);
}
</script>
</head>
<body>
<button onclick="function1();">
Click here while pressing the Shift key
</button>
</body>
</html>
"cancelBubble" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |event |
+----------------+--------------------------------------------------------------+
"cancelBubble" Possible Values
Possible Values
true
false the default
"cancelBubble" Syntax and Note
Note:
Read and write property.
Sets whether or not the current event stops bubbling through the document hierarchy.
Syntax:
window.event.cancelBubble = value