Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含一些TH元素的 html 表。我通过 jQuery 找到了一个特定TH的,我需要知道它的index。我TH通过这样的代码找到了:
TH
var th = $("#txtmin").parent();
我怎样才能做到这一点?
你可以这样做:
$("#txtmin").closest('th').index();
$("#txtmin").parent().index();