当前位置:网站首页>How JQ gets the reciprocal elements
How JQ gets the reciprocal elements
2022-06-27 05:03:00 【Front cut zz】
<ul>
<li> Penultimate </li>
<li> The third from the bottom </li>
<li> second to last </li>
<li> The last one </li>
</ul>
jq Get last element :
var text = $('ul li').last().text()
console.log(text)
Print the results :
jq Get the penultimate element :
var text = $('ul li').eq(-2).text()
console.log(text)
Print the results :
expand :
eq() Method : Returns the element with the specified index number of the selected element .
grammar
$(selector).eq(index)
index There has to be , Index used to specify elements . It can be an integer or a negative number . among , Using a negative number will calculate the index from the end of the selected element .
边栏推荐
- 机械转码日记【17】模板,STL简介
- 跟着BUU学习Crypto(周更)
- Terminal in pychar cannot enter the venv environment
- 渗透测试-目录遍历漏洞
- Microservice system design -- unified authentication service design
- 018 basics of C language: C file reading and writing
- 微服务系统设计——微服务监控与系统资源监控设计
- 躲避小行星游戏
- Microservice system design -- API gateway service design
- 013 C语言基础:C指针
猜你喜欢

Cognition - how to fill in 2022 college entrance examination volunteers

Microservice system design -- unified authentication service design

【622. 设计循环队列】

Redis high availability cluster (sentry, cluster)

jq怎么获取倒数的元素

【B站UP DR_CAN学习笔记】Kalman滤波2

Microservice system design -- microservice monitoring and system resource monitoring design

QChart笔记2: 添加鼠标悬停显示

什么是BFC?有什么用?

微服务系统设计——微服务调用设计
随机推荐
Execution rules of pytest framework
020 C语言基础:C语言强制类型转换与错误处理
Edge在IE模式下加载网页 - Edge设置IE兼容性
Golang Hello installation environment exception [resolved]
017 basics of C language: bit field and typedef
014 C语言基础:C字符串
Flink production problems (1.10)
《数据库原理与应用》第一版 马春梅……编著 期末复习笔记
1.5 use of CONDA
第1章 绪论
MySql最详细的下载教程
STM32关闭PWM输出时,让IO输出固定高或低电平的方法。
微服务系统设计——统一鉴权服务设计
Redis high availability cluster (sentry, cluster)
halcon常用仿射变换算子
渗透测试-目录遍历漏洞
高翔slam14讲-笔记1
Installation of low code development platform nocobase
Matlab | drawing of three ordinate diagram based on block diagram layout
019 C语言基础:C预处理