JQuery How to extract value from href tag?

前端 未结 6 1164
野性不改
野性不改 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:44

    First of all you need to extract the path with something like this:

    $("a#myLink").attr("href");
    

    Then take a look at this plugin: http://plugins.jquery.com/project/query-object

    It will help you handle all kinds of querystring things you want to do.

    /Peter F

提交回复
热议问题