Computers & ProgrammingFrontend DevelopmentjQuery

jQuery Target Event

The jQuery event target provides information about which DOM element triggered the event.

eventSpecifies the event to check.

Basic Example

In the following jQuery example, the target event’s properties can be accessed to determine which HTML element is clicked in the document.

<!DOCTYPE html>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
            $("p, h1, h2, div, table, tr, th, td").click(function (e) {
                $("#div1").html("Triggered by the ... ");
    <div id="div1"></div>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top