<!DOCTYPE html>
<html>
<head>
<title>isTrusted Event Property in HTML</title>
<style>
h1 {
color:green;
}
h2 {
font-family:Impact;
}
body {
text-align:center;
}
</style>
</head>
<body onclick="MyEvent(event)">
<h1>GeeksforGeeks</h1>
<h2>isTrusted Event Property</h2>
<p>Double Click the "Check Event"
button to check whether the event
is trusted or not.</p>
<button ondblclick="MyEvent(event)">
Try it
</button>
<script>
// Check whether the event is trusted or not.
function MyEvent(event) {
debugger;
if ("isTrusted" in event) {
if (event.isTrusted) {
alert("The " + event.type +
" is a trusted event.");
} else {
alert("The " + event.type +
" is not a trusted event.");
}
} else {
alert("Your browser does not support "
+"the isTrusted property");
}
}
</script>
</body>
</html>