composed returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target; otherwise false.
1
2
<!doctype html>
<html>
<body>
<p></p>
<script>
function myfunction(event)
{
document.querySelector("p").innerHTML = event.composed;
}
var type = "mytype";
var eventInitDict =
{
composed: true
};
var event = new Event(type, eventInitDict);
document.addEventListener(type, myfunction);
document.dispatchEvent(event);
</script>
</body>
</html>
3
<!doctype html>
<html>
<body>
<button>button</button>
<p></p>
<script>
function myfunction(event)
{
document.querySelector("p").innerHTML = event.composed;
}
document.querySelector("button").addEventListener("mouseover", myfunction);
</script>
</body>
</html>
Internal
External