• Home >Web Front-end >JS Tutorial >Get the clicked tab page through the same class in jQuery

    Get the clicked tab page through the same class in jQuery

    巴扎黑
    巴扎黑Original
    2017-07-20 13:30:221443browse

    Judge which tab page is clicked

    • ##jsp:

    6ead9c5b83542d525c3552c73ce7e24a
         6072cf9f6bd7b20ca2e4e430b3e487ad
         f37b80ce75c4a80393a835e2e5f17753tab15db79b134e9f6b82c0b36e0489ee08ed
          bed06894275b65c1ab86501b08a632eb
          058e8cffef777e1aab16dedaa108b0ee
    378911fc24bb1861f825ad6c529de1e6tab25db79b134e9f6b82c0b36e0489ee08ed
        bed06894275b65c1ab86501b08a632eb
     929d1f5ca49e04fdcb27f9465b944689
    • js:

     $('.stability-test').click(function(e) {
            var $this = $(e.target);
            marker = $this.data('marker');
        });
    Another method is:

    There is an index() event in jq to obtain the current position. The specific usage is as follows:

    $(".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!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn