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.
<a href="Search/Advanced?page=2">2</a>
Malcolm
The first thing that comes to my mind is a one-liner regex:
var pageNum = $("#specificLink").attr("href").match(/page=([0-9]+)/)[1];
2.1m questions
2.1m answers
60 comments
57.0k users