javascript - How to achieve accurate matching of Jquary's contains
typecho
typecho 2017-07-05 10:40:51
0
3
861

$("span:contains(" pageNum ")").addClass("current")
pageNum is the subscript of the page, but if pageNum is 1, then 10, 11, and 12 will all execute addClass. Is there any good way to do this? Achieve accurate matching?

typecho
typecho

Following the voice in heart.

reply all(3)
小葫芦
修改
大家讲道理

When rendering the subscript, add the index to the span's class. When retrieving, get the index through the current page number, and then add the class to the span corresponding to the index.

巴扎黑

Just use this

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!