Check which element has been clicked with jQuery

前端 未结 7 678
天命终不由人
天命终不由人 2020-12-24 07:10

I am trying to use an \'if\' statement to determine which element was clicked.

Basically I am trying to code something along the lines of:

if (the el         


        
7条回答
  •  半阙折子戏
    2020-12-24 07:49

    The basis of jQuery is the ability to find items in the DOM through selectors, and then checking properties on those selectors. Read up on Selectors here:

    http://api.jquery.com/category/selectors/

    However, it would make more sense to create event handlers for the click events for the different functionality that should occur based on what is clicked.

提交回复
热议问题