Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1005877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:22:03+00:00 2026-05-16T08:22:03+00:00

I have a URL that is like: www.example.com/task1/1.3.html#a_1 How can I get the a_1

  • 0

I have a URL that is like:

www.example.com/task1/1.3.html#a_1

How can I get the a_1 anchor value using jQuery and store it as a variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:22:03+00:00Added an answer on May 16, 2026 at 8:22 am

    You can use the .indexOf() and .substring(), like this:

    var url = "www.aaa.com/task1/1.3.html#a_1";
    var hash = url.substring(url.indexOf("#")+1);
    

    You can give it a try here, if it may not have a # in it, do an if(url.indexOf("#") != -1) check like this:

    var url = "www.aaa.com/task1/1.3.html#a_1", idx = url.indexOf("#");
    var hash = idx != -1 ? url.substring(idx+1) : "";
    

    If this is the current page URL, you can just use window.location.hash to get it, and replace the # if you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL that is like the following: http://www.example.com/client/project/subdirectory/value/ I would like like
If I have a URL like: http://www.example.com:9090/test.html Then I know that www.example.com is the
I have url that looks like this... http://www.example.com/accounts/?token=111978178853984|683b8096732be7fd725d3332-557626087|m9lSbmoYhZ6Yut4OC3smY1fRf1E. from the token 111978178853984|683b8096732be7fd725d3332- 557625434 |m9lSbmoYhZ6Yut4OC3smY1fRf1E
If I have a URL that is http://www.example.com/sites/dir/index.html , I would want to extract
I have this .htaccess that I've been using to rewrite URLs like these: www.example.com/index.php?page=brand
I have an URL like this http://www.example.com/Data/image/office-dôn-sì-à.jpg I want to copy that file to
I have a url like the following: http://www.example.com/cat/دسته/page/2/ As you can see there is
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I have a url that looks like that http://example.com/index.php?id=111&title=word1 word2 word3 I need to
So... I have a URL like www.example.com/stream/ I need to make any request to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.