Home >Web Front-end >JS Tutorial >Get the clicked tab page through the same class in jQuery
- ##jsp:
6ead9c5b83542d525c3552c73ce7e24a 6072cf9f6bd7b20ca2e4e430b3e487ad f37b80ce75c4a80393a835e2e5f17753tab15db79b134e9f6b82c0b36e0489ee08ed bed06894275b65c1ab86501b08a632eb 058e8cffef777e1aab16dedaa108b0ee 378911fc24bb1861f825ad6c529de1e6tab25db79b134e9f6b82c0b36e0489ee08ed bed06894275b65c1ab86501b08a632eb 929d1f5ca49e04fdcb27f9465b944689
Another method is: There is an index() event in jq to obtain the current position. The specific usage is as follows:
- js:
$('.stability-test').click(function(e) { var $this = $(e.target); marker = $this.data('marker'); });
$(".class").click(function(){ alert($(this).index()); })//这个弹出的就是点击的class是第几个
The above is the detailed content of Get the clicked tab page through the same class in jQuery. For more information, please follow other related articles on the PHP Chinese website!