JQuery How to extract value from href tag?

前端 未结 6 1174
野性不改
野性不改 2020-12-01 02:20

I am new to JQuery.

If I have the following tag. What is the best JQuery method to extract the value for \"page\" from the href.



        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 02:43

    if ($('a').on('Clicked').text().search('1') == -1)
    {
        //Page == 1
    }
    else
    {
        //Page != 1
    }
    

提交回复
热议问题