2009-10-31 33 views

Trả lời

22

$(element).parent() trả về cấp độ gốc ngay lập tức.

$("#my-button").click(function() { 
    var parentElement = $(this).parent(); 
    // etc... 
}); 

http://docs.jquery.com/Traversing/parent

+0

Yea, http://docs.jquery.com/Traversing/parent để biết thêm –

Các vấn đề liên quan