jquery click event to get the index value of the element in the whole class of elements

In the div, there is a class of div tags, the class value is pointbox, the number varies, and there are multiple. When I click on a label, I need to get the index value of the label in this type of label in real time for other operations.

The code is simple:

$(".pointbox").click(function () {
       
  var index=$(".pointbox").index($(this));
       
});

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325062748&siteId=291194637