admin 发表于 2024-5-25 17:25:49

$(this).find('p') this获取子元素的值

直接上代码:

$('.childcate').click(function(){
            var categoryid = $(this).data('id');
            var categoryname = $(this).find('p').text();
            alert(categoryname);
            //$('#cate-box').addClass('hide');
    });

页: [1]
查看完整版本: $(this).find('p') this获取子元素的值