jQuery的:last-of-type
选择器可以帮助我们快速选取指定类型的一个元素。使用方法很简单,只需要在jQuery选择器中加上:last-of-type
即可。例如,我们想要选取一个标签,就可以这样写:
$("p:last-of-type")
我们也可以指定更多条件,例如:
$("p.test:last-of-type")
这样就可以选取一个class为test的标签。
jQuery的:last-of-type
选择器可以帮助我们快速选取指定类型的一个元素,使用方法非常简单,只需要在jQuery选择器中加上:last-of-type
即可,并且我们也可以指定更多条件,例如class等。