javascript - How to achieve accurate matching of Jquary's contains
typecho2017-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?
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.
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