Q:

Check whether the event namespace is used using jquery

0

Check whether the event namespace is used ,using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Check whether the event namespace is used.</title>
</head>
<body>
<button>Display event.namespace</button>
<p></p>
</body>
</html>

JavaScript Code :

$( "p" ).on( "test.myNamespace", function( event ) {
console.log(event.namespace );
});
$( "button" ).click(function( event ) {
$( "p" ).trigger( "test.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now