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.
我正在尝试从另一个 DOM 元素触发单击其中一个导航点,但我似乎无法按照以下方式进行操作:
$('li.dot')[0].click();
任何帮助表示赞赏。
编辑:对不起,我通常不使用 jQuery。我忘记了您需要使用 first 或 first-child 或其他类型来从 jQuery 对象中获取节点,而不是使用 el[0]。
$('li.dot').first().trigger('click');